Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client/assets/fonts/BRUSHSCI.TTF
Binary file not shown.
Binary file added client/assets/fonts/Roboto-Bold.ttf
Binary file not shown.
Binary file added client/assets/glasses.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions common/component/layout/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@font-face
{
font-family: myFirstFont;
src: url('../../../client/assets/fonts/Roboto-Bold.ttf');
}

.name{
/*display:none;*/
/*background-color: red;*/
/*background-image: url('./assets/glasses.png')*/
font-family: myFirstFont
}
2 changes: 1 addition & 1 deletion common/component/page/Indexpage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Indexpage extends Component {
zDepth={0}
>
<Paper style={styles.avatarContainer} zDepth={1} circle={true}>
<img style={styles.avatar} src="img/avatar.jpg"/>
<img style={styles.avatar} src="uploadImg/avatar.jpg"/>
</Paper>
<h1 style={styles.siteIntro}>Hello Welcome to My Blog Site</h1>
<Link to="/posts">
Expand Down
18 changes: 18 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
require('babel-polyfill');
//加载样式钩子,补足服务端渲染无法识别CSS文件的情况
require('css-modules-require-hook')({
extensions: ['.css'],
generateScopedName: '[name]__[local]-[hash:base64:8]'
});
// Image required hook
//引入asset-require-hook,来识别图片资源,对小于8K的图片转换成base64字符串,大于8k的图片转换成路径引用。
require('asset-require-hook')({
extensions: ['jpg', 'png', 'gif','webp'],
limit: 10000
});
//处理字体
require('asset-require-hook')({
extensions: ['ttf','woff','svg','eot','woff2'],
limit: 10000
});

//启动服务端脚本
require('./server/server');
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"homepage": "https://github.com/BetaMee/ReactBlog#readme",
"dependencies": {
"asset-require-hook": "^1.0.2",
"config-lite": "^1.5.0",
"connect-flash": "^0.1.1",
"connect-mongo": "^1.3.2",
Expand Down Expand Up @@ -66,6 +67,7 @@
"css-loader": "^0.26.1",
"css-modules-require-hook": "^4.0.5",
"extract-text-webpack-plugin": "^2.0.0-rc.3",
"file-loader": "^0.10.0",
"isomorphic-style-loader": "^1.1.0",
"node-sass": "^4.5.0",
"postcss-loader": "^1.3.1",
Expand All @@ -75,6 +77,7 @@
"redux-devtools-log-monitor": "^1.2.0",
"sass-loader": "^6.0.2",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^2.2.1",
"webpack-dev-middleware": "^1.10.1",
"webpack-dev-server": "^2.4.1",
Expand Down
3 changes: 2 additions & 1 deletion server/lib/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function renderFullPage(html, initiaState,env) {
<meta charset="UTF-8">
<title>十二棵橡树</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/assets/bundle.css">
<style>
body{
margin:0px;
Expand All @@ -47,7 +48,7 @@ function renderFullPage(html, initiaState,env) {
<script>
window.__INITIAL_STATE__ = ${JSON.stringify(initiaState)};
</script>
<script src="/js/client.bundle.js"></script>
<script src="/assets/client.bundle.js"></script>
</body>
</html>
`;
Expand Down
12 changes: 12 additions & 0 deletions server/public/assets/bundle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@font-face
{
font-family: myFirstFont;
src: url(/assets/bundleFonts/e31fcf18-Roboto-Bold.ttf);
}

.Header__name-2RC4N{
/*display:none;*/
/*background-color: red;*/
/*background-image: url('./assets/glasses.png')*/
font-family: myFirstFont
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions server/public/img/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions server/public/js/bundle.css

This file was deleted.

Binary file added server/public/uploadImg/avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions server/public/uploadImg/components.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions server/public/uploadImg/css-framework.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading