Skip to content

Commit af44761

Browse files
committed
init
1 parent e593bba commit af44761

32 files changed

+3444
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# A framework for person blog
2+
3+
## Status
4+
Not finished
5+
6+
## Usage
7+
```bash
8+
node index.js
9+
```

_config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: "竖八不正"
2+
description:
3+
keywords:
4+
avatar:
5+
src:
6+
bgSrc:
7+
profile:
8+
name:
9+
secondName:
10+
description:
11+
url:
12+
blog:
13+
github:
14+
weibo:
15+

index.html

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
<style>
7+
body {
8+
font-family: 'Droid Sans Mono', monospace;
9+
}
10+
.code {
11+
position: absolute;
12+
top: 50%;
13+
left: 50%;
14+
transform: translate(-50%, -50%);
15+
text-align: center;
16+
}
17+
h1 {
18+
position: relative;
19+
font-size: 3vw;
20+
color: #fff;
21+
}
22+
h1:after {
23+
content: '';
24+
height: 140%;
25+
width: 1px;
26+
background: transparent;
27+
position: absolute;
28+
display: block;
29+
right: -1vw;
30+
top: -20%;
31+
animation: blink 1.2s linear infinite;
32+
}
33+
h2 {
34+
margin-top: 10%;
35+
font-size: 2vw;
36+
color: #59b75c;
37+
}
38+
@-moz-keyframes blink {
39+
49% {
40+
background: transparent;
41+
}
42+
50% {
43+
background: #fff;
44+
}
45+
100% {
46+
background: #fff;
47+
}
48+
}
49+
@-webkit-keyframes blink {
50+
49% {
51+
background: transparent;
52+
}
53+
50% {
54+
background: #fff;
55+
}
56+
100% {
57+
background: #fff;
58+
}
59+
}
60+
@-o-keyframes blink {
61+
49% {
62+
background: transparent;
63+
}
64+
50% {
65+
background: #fff;
66+
}
67+
100% {
68+
background: #fff;
69+
}
70+
}
71+
@keyframes blink {
72+
49% {
73+
background: transparent;
74+
}
75+
50% {
76+
background: #fff;
77+
}
78+
100% {
79+
background: #fff;
80+
}
81+
}
82+
.code{
83+
display: flex;
84+
flex-direction: column;
85+
}
86+
.code span{
87+
flex: 1;
88+
background-color: red;
89+
}
90+
</style>
91+
</head>
92+
<body>
93+
<div class="code">
94+
<span class=""></span>
95+
<span></span>
96+
</div>
97+
</body>
98+
</html>

index.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Created by chenze on 16/6/18.
3+
*/
4+
var mm = require('marky-mark');
5+
var fs = require('fs');
6+
var ejs = require('ejs');
7+
var YAML = require('yamljs');
8+
//var toc = require('markdown-toc');
9+
var data = {};
10+
data.setting = YAML.load('./_config.yml');
11+
readFile = (src) => {return fs.readFileSync(src,'utf-8')};
12+
var postTemplate = readFile('./source/template/post.ejs');
13+
var catTemplate = readFile('./source/template/category.ejs');
14+
var indexTemplate = readFile('./source/template/index.ejs');
15+
mm.parseDirectory(__dirname + "/source/_posts", function(err, posts) {
16+
var path = __dirname + '/blog/';
17+
data.article = [];
18+
posts.forEach(v => {
19+
var date = new Date(v.meta.date).toLocaleDateString().split('/');
20+
data.article.push({
21+
year: date[2],
22+
month: date[0],
23+
date: date[1],
24+
content: v.content,
25+
title: v.meta.title,
26+
tags: v.meta.tags,
27+
category: v.meta.category,
28+
meta: v.meta,
29+
href: '/blog/'+date[2]+'/'+date[0]+'/'+date[1]+'/'
30+
});
31+
});
32+
ejs.renderFile(filename, data, options, function(err, str){
33+
34+
});
35+
36+
});
37+
//TODO Add toc filter
38+
//TODO Add highlight in Server side

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "chenze-blog",
3+
"version": "1.0.0",
4+
"description": "A blog website build by nick-ChenZe",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [
10+
"blog",
11+
"tech",
12+
"front-end"
13+
],
14+
"author": "nick-Chenze",
15+
"license": "MIT",
16+
"dependencies": {
17+
"ejs": "^2.4.2",
18+
"fontawesome": "^4.5.0",
19+
"markdown-toc": "^0.12.12",
20+
"marky-mark": "^1.2.1",
21+
"yamljs": "^0.2.8"
22+
}
23+
}

resume/css/normalize.css

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
/*! normalize.css v4.0.0 | MIT License | github.com/necolas/normalize.css */
2+
html {
3+
font-family: sans-serif;
4+
-ms-text-size-adjust: 100%;
5+
-webkit-text-size-adjust: 100%
6+
}
7+
8+
body {
9+
margin: 0
10+
}
11+
12+
article, aside, details, figcaption, figure, footer, header, main, menu, nav, section, summary {
13+
display: block
14+
}
15+
16+
audio, canvas, progress, video {
17+
display: inline-block
18+
}
19+
20+
audio:not([controls]) {
21+
display: none;
22+
height: 0
23+
}
24+
25+
progress {
26+
vertical-align: baseline
27+
}
28+
29+
template, [hidden] {
30+
display: none
31+
}
32+
33+
a {
34+
background-color: transparent
35+
}
36+
37+
a:active, a:hover {
38+
outline-width: 0
39+
}
40+
41+
abbr[title] {
42+
border-bottom: none;
43+
text-decoration: underline;
44+
text-decoration: underline dotted
45+
}
46+
47+
b, strong {
48+
font-weight: inherit
49+
}
50+
51+
b, strong {
52+
font-weight: bolder
53+
}
54+
55+
dfn {
56+
font-style: italic
57+
}
58+
59+
h1 {
60+
font-size: 2em;
61+
margin: 0.67em 0
62+
}
63+
64+
mark {
65+
background-color: #ff0;
66+
color: #000
67+
}
68+
69+
small {
70+
font-size: 80%
71+
}
72+
73+
sub, sup {
74+
font-size: 75%;
75+
line-height: 0;
76+
position: relative;
77+
vertical-align: baseline
78+
}
79+
80+
sub {
81+
bottom: -0.25em
82+
}
83+
84+
sup {
85+
top: -0.5em
86+
}
87+
88+
img {
89+
border-style: none
90+
}
91+
92+
svg:not(:root) {
93+
overflow: hidden
94+
}
95+
96+
code, kbd, pre, samp {
97+
font-family: monospace, monospace;
98+
font-size: 1em
99+
}
100+
101+
figure {
102+
margin: 1em 40px
103+
}
104+
105+
hr {
106+
box-sizing: content-box;
107+
height: 0;
108+
overflow: visible
109+
}
110+
111+
button, input, select, textarea {
112+
font: inherit;
113+
margin: 0
114+
}
115+
116+
optgroup {
117+
font-weight: bold
118+
}
119+
120+
button, input, select {
121+
overflow: visible
122+
}
123+
124+
button, select {
125+
text-transform: none
126+
}
127+
128+
button, [type="button"], [type="reset"], [type="submit"] {
129+
cursor: pointer
130+
}
131+
132+
[disabled] {
133+
cursor: default
134+
}
135+
136+
button, html [type="button"], [type="reset"], [type="submit"] {
137+
-webkit-appearance: button
138+
}
139+
140+
button::-moz-focus-inner, input::-moz-focus-inner {
141+
border: 0;
142+
padding: 0
143+
}
144+
145+
button:-moz-focusring, input:-moz-focusring {
146+
outline: 1px dotted ButtonText
147+
}
148+
149+
fieldset {
150+
border: 1px solid #c0c0c0;
151+
margin: 0 2px;
152+
padding: 0.35em 0.625em 0.75em
153+
}
154+
155+
legend {
156+
box-sizing: border-box;
157+
color: inherit;
158+
display: table;
159+
max-width: 100%;
160+
padding: 0;
161+
white-space: normal
162+
}
163+
164+
textarea {
165+
overflow: auto
166+
}
167+
168+
[type="checkbox"], [type="radio"] {
169+
box-sizing: border-box;
170+
padding: 0
171+
}
172+
173+
[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button {
174+
height: auto
175+
}
176+
177+
[type="search"] {
178+
-webkit-appearance: textfield
179+
}
180+
181+
[type="search"]::-webkit-search-cancel-button, [type="search"]::-webkit-search-decoration {
182+
-webkit-appearance: none
183+
}

0 commit comments

Comments
 (0)