Skip to content

Commit 1cc8528

Browse files
committedJul 5, 2017
complete demo
0 parents  commit 1cc8528

24 files changed

+3297
-0
lines changed
 

‎.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
Thumbs.db
3+
db.json
4+
*.log
5+
node_modules/
6+
public/
7+
.deploy*/
8+
docs/themes/landscape/

‎README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 使用 Hexo 创建项目文档网站
2+
3+
这是 [使用 Hexo 创建项目文档网站](https://github.com/nodejh/nodejh.github.io/issues/37) 这篇博客的代码。
4+
5+
## 使用
6+
7+
```sh
8+
$ git clone https://github.com/nodejh/hexo-documentation
9+
$ cd hexo-documentation
10+
$ cd docs
11+
$ npm install
12+
$ hexo server
13+
```
14+
15+
然后通过 `http://localhost:4000` 预览。

‎docs/.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
Thumbs.db
3+
db.json
4+
*.log
5+
node_modules/
6+
public/
7+
.deploy*/

‎docs/_config.yml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Hexo Configuration
2+
## Docs: https://hexo.io/docs/configuration.html
3+
## Source: https://github.com/hexojs/hexo/
4+
5+
# Site
6+
title: Hexo documentation
7+
subtitle: Hexo documentation article
8+
description: Hexo documentation article
9+
author: nodejh
10+
language: zh-cn
11+
timezone: GMT
12+
13+
# URL
14+
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
15+
url: https://nodejh.github.io/hexo-documentation
16+
root: /
17+
permalink: :year/:month/:day/:title/
18+
permalink_defaults:
19+
20+
# Directory
21+
source_dir: source
22+
public_dir: public
23+
tag_dir: tags
24+
archive_dir: archives
25+
category_dir: categories
26+
code_dir: downloads/code
27+
i18n_dir: :lang
28+
skip_render:
29+
30+
# Writing
31+
new_post_name: :title.md # File name of new posts
32+
default_layout: post
33+
titlecase: false # Transform title into titlecase
34+
external_link: true # Open external links in new tab
35+
filename_case: 0
36+
render_drafts: false
37+
post_asset_folder: false
38+
relative_link: false
39+
future: true
40+
highlight:
41+
enable: true
42+
line_number: true
43+
auto_detect: false
44+
tab_replace:
45+
46+
# Category & Tag
47+
default_category: uncategorized
48+
category_map:
49+
tag_map:
50+
51+
# Date / Time format
52+
## Hexo uses Moment.js to parse and display date
53+
## You can customize the date format as defined in
54+
## http://momentjs.com/docs/#/displaying/format/
55+
date_format: YYYY-MM-DD
56+
time_format: HH:mm:ss
57+
58+
# Pagination
59+
## Set per_page to 0 to disable pagination
60+
per_page: 10
61+
pagination_dir: page
62+
63+
# Extensions
64+
## Plugins: https://hexo.io/plugins/
65+
## Themes: https://hexo.io/themes/
66+
theme: documentation
67+
68+
# Deployment
69+
## Docs: https://hexo.io/docs/deployment.html
70+
deploy:
71+
type: git
72+
repo: https://github.com/nodejh/hexo-documentation
73+
branch: gh-pages
74+
message: "Docs updated: {{ now('YYYY-MM-DD HH:mm:ss') }})"

‎docs/package-lock.json

+2,644
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "hexo-site",
3+
"version": "0.0.0",
4+
"private": true,
5+
"hexo": {
6+
"version": "3.3.7"
7+
},
8+
"dependencies": {
9+
"hexo": "^3.2.0",
10+
"hexo-generator-archive": "^0.1.4",
11+
"hexo-generator-category": "^0.1.3",
12+
"hexo-generator-index": "^0.2.0",
13+
"hexo-generator-tag": "^0.2.0",
14+
"hexo-renderer-ejs": "^0.2.0",
15+
"hexo-renderer-marked": "^0.2.10",
16+
"hexo-renderer-sass": "^0.3.2",
17+
"hexo-renderer-stylus": "^0.3.1",
18+
"hexo-server": "^0.2.0"
19+
}
20+
}

‎docs/scaffolds/draft.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: {{ title }}
3+
tags:
4+
---

‎docs/scaffolds/page.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: {{ title }}
3+
date: {{ date }}
4+
---

‎docs/scaffolds/post.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: {{ title }}
3+
date: {{ date }}
4+
tags:
5+
---

‎docs/source/_data/nav.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- title: Introduction
2+
items:
3+
- id: what-is-it
4+
title: What is it?
5+
- id: how-it-works
6+
title: How it works
7+
- title: Usage
8+
items:
9+
- id: installation
10+
title: Installation
11+
- id: using
12+
title: Using It

‎docs/source/_posts/hello-world.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Hello World
3+
---
4+
Welcome to [Hexo](https://hexo.io/)! This is your very first post. Check [documentation](https://hexo.io/docs/) for more info. If you get any problems when using Hexo, you can find the answer in [troubleshooting](https://hexo.io/docs/troubleshooting.html) or you can ask me on [GitHub](https://github.com/hexojs/hexo/issues).
5+
6+
## Quick Start
7+
8+
### Create a new post
9+
10+
``` bash
11+
$ hexo new "My New Post"
12+
```
13+
14+
More info: [Writing](https://hexo.io/docs/writing.html)
15+
16+
### Run server
17+
18+
``` bash
19+
$ hexo server
20+
```
21+
22+
More info: [Server](https://hexo.io/docs/server.html)
23+
24+
### Generate static files
25+
26+
``` bash
27+
$ hexo generate
28+
```
29+
30+
More info: [Generating](https://hexo.io/docs/generating.html)
31+
32+
### Deploy to remote sites
33+
34+
``` bash
35+
$ hexo deploy
36+
```
37+
38+
More info: [Deployment](https://hexo.io/docs/deployment.html)

‎docs/source/how-it-works.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: default
3+
id: how-it-works
4+
title: How it works?
5+
prev: index.html
6+
next: installation.html
7+
---
8+
9+
This is our how it works markdown file

‎docs/source/installation.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: default
3+
id: installation
4+
title: Installation
5+
prev: how-it-works.html
6+
next: using.html
7+
---
8+
9+
This is our installation markdown file

‎docs/source/using.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: default
3+
id: using
4+
title: Using
5+
prev: installation.html
6+
---
7+
8+
This is our using markdown file

‎docs/source/what-is-it.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: default
3+
id: what-is-it
4+
title: What is it?
5+
next: how-it-works.html
6+
---
7+
8+
This is our what it is markdown file
9+
10+
- one
11+
- two
12+
- three

‎docs/themes/documentation/_config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_sass:
2+
outputStyle: nested
3+
precision: 4
4+
sourceComments: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charSet='utf-8' />
5+
<title>{{config.title + ' - ' + page.title}}</title>
6+
<link href='https://cdnjs.cloudflare.com/ajax/libs/normalize/4.0.0/normalize.min.css' rel='stylesheet' type='text/css'>
7+
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,300,700' rel='stylesheet' type='text/css'>
8+
<link href='{{ url_for("css/docs.css") }}' rel='stylesheet'>
9+
</head>
10+
<body>
11+
<div class='index'>
12+
<a href="/what-is-it.html">
13+
Get Start
14+
</a>
15+
</div>
16+
</body>
17+
</html>
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charSet='utf-8' />
5+
<title>{{config.title + ' - ' + page.title}}</title>
6+
<link href='https://cdnjs.cloudflare.com/ajax/libs/normalize/4.0.0/normalize.min.css' rel='stylesheet' type='text/css'>
7+
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,300,700' rel='stylesheet' type='text/css'>
8+
<link href='{{ url_for("css/docs.css") }}' rel='stylesheet'>
9+
</head>
10+
<body>
11+
<div class='menu'>
12+
<div class='logo'>
13+
Documentation
14+
</div>
15+
<nav class='menu-nav'>
16+
{% for section in site.data.nav %}
17+
<ul class='nav'>
18+
<span>{{ section.title }}</span>
19+
<ul class='nav'>
20+
{% for item in section.items %}
21+
<li>
22+
<a href='{{item.href || url_for(item.id + ".html") }}'{% if item.id == page.id %} class='active'{% endif %}>{{item.title}}</a>
23+
</li>
24+
{% endfor %}
25+
</ul>
26+
</ul>
27+
{% endfor %}
28+
</nav>
29+
<a class='footer' href='https://github.com/nodejh/hexo-documentation'>
30+
Project on github
31+
</a>
32+
</div>
33+
<div class='page'>
34+
<div class='page-content'>
35+
<h1>{{page.title}}</h1>
36+
{{page.content}}
37+
</div>
38+
</div>
39+
<div class='switch-page'>
40+
{% if page.prev %}
41+
<a class='previous' href='{{ url_for(page.prev) }}'>Previous</a>
42+
{% endif %}
43+
{% if page.next %}
44+
<a class='next' href='{{ url_for(page.next) }}'>Next</a>
45+
{% endif %}
46+
</div>
47+
</body>
48+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
$codeBackColor: #fbfbfb;
2+
3+
code {
4+
color: #4D4D4C;
5+
}
6+
7+
code, tt {
8+
margin: 0 2px;
9+
padding: 0 5px;
10+
white-space: nowrap;
11+
// border: 1px solid #eaeaea;
12+
background-color: $codeBackColor;
13+
font-family: monospace, Consolas,"Liberation Mono",Menlo,Courier,monospace;
14+
}
15+
16+
pre code {
17+
margin: 0;
18+
padding: 0;
19+
white-space: pre;
20+
border: none;
21+
background: transparent;
22+
}
23+
24+
.highlight {
25+
font-family: monospace, Consolas,"Liberation Mono",Menlo,Courier,monospace;
26+
background-color: $codeBackColor;
27+
border: 1px solid $bordersColor;
28+
font-size: 13px;
29+
line-height: 19px;
30+
overflow: auto;
31+
padding: 0;
32+
border-radius: 3px;
33+
table {
34+
width: 100%;
35+
.gutter, .code {
36+
border: 0;
37+
}
38+
.gutter {
39+
white-space: nowrap;
40+
border-right: 1px solid $bordersColor;
41+
42+
pre {
43+
color: #999;
44+
}
45+
}
46+
.code {
47+
width: 99%;
48+
}
49+
}
50+
}
51+
52+
.highlight pre {
53+
background-color: $codeBackColor;
54+
// border: 1px solid #cccccc;
55+
font-size: 13px;
56+
line-height: 19px;
57+
overflow: auto;
58+
padding: 6px 10px;
59+
border-radius: 3px;
60+
margin-bottom: 0;
61+
}
62+
63+
pre code, pre tt {
64+
background-color: transparent;
65+
border: none;
66+
}
67+
68+
.editor, .editor .gutter {
69+
background-color: #FFFFFF;
70+
color: #4D4D4C;
71+
}
72+
73+
.editor.is-focused .cursor {
74+
border-color: #AEAFAD;
75+
}
76+
77+
.editor.is-focused .selection .region {
78+
background-color: #D6D6D6;
79+
}
80+
81+
.editor.is-focused .line-number.cursor-line-no-selection, .editor.is-focused .line.cursor-line {
82+
background-color: #EFEFEF;
83+
}
84+
85+
.comment {
86+
color: #8E908C;
87+
}
88+
89+
.keyword.operator.class, .constant.other, .source.php.embedded.line {
90+
color: #666969;
91+
}
92+
93+
.variable, .support.other.variable, .string.other.link, .string.regexp, .entity.name.tag, .entity.other.attribute-name, .meta.tag, .declaration.tag, .markup.deleted.git_gutter {
94+
color: #C82829;
95+
}
96+
97+
.constant.numeric, .constant.language, .support.constant, .constant.character, .variable.parameter, .punctuation.section.embedded, .keyword.other.unit {
98+
color: #F5871F;
99+
}
100+
101+
.entity.name.class, .entity.name.type.class, .support.type, .support.class {
102+
color: #C99E00;
103+
}
104+
105+
.string, .constant.other.symbol, .entity.other.inherited-class, .entity.name.filename, .markup.heading, .markup.inserted.git_gutter {
106+
color: #718C00;
107+
}
108+
109+
.keyword.operator, .constant.other.color {
110+
color: #3E999F;
111+
}
112+
113+
.entity.name.function, .meta.function-call, .support.function, .keyword.other.special-method, .meta.block-level, .markup.changed.git_gutter {
114+
color: #4271AE;
115+
}
116+
117+
.keyword, .storage, .storage.type {
118+
color: #8959A8;
119+
}
120+
121+
.invalid {
122+
color: #FFFFFF;
123+
background-color: #C82829;
124+
}
125+
126+
.meta.separator {
127+
color: #FFFFFF;
128+
background-color: #4271AE;
129+
}
130+
131+
.invalid.deprecated {
132+
color: #FFFFFF;
133+
background-color: #8959A8;
134+
}
135+
136+
.markup.inserted.diff, .markup.deleted.diff, .meta.diff.header.to-file, .meta.diff.header.from-file {
137+
color: #FFFFFF;
138+
}
139+
140+
.markup.inserted.diff, .meta.diff.header.to-file {
141+
background-color: #718c00;
142+
}
143+
144+
.markup.deleted.diff, .meta.diff.header.from-file {
145+
background-color: #c82829;
146+
}
147+
148+
.meta.diff.header.from-file, .meta.diff.header.to-file {
149+
color: #FFFFFF;
150+
background-color: #4271ae;
151+
}
152+
153+
.meta.diff.range {
154+
font-style: italic;
155+
color: #3e999f;
156+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.page {
2+
padding-left: $menuWidth;
3+
}
4+
5+
.page-content {
6+
padding: 40px;
7+
margin: 0 auto;
8+
width: 885px;
9+
max-width: 100%;
10+
padding-bottom: 80px;
11+
}
12+
13+
img {
14+
max-width: 100%;
15+
}
16+
17+
.switch-page {
18+
position: fixed;
19+
height: 55px;
20+
background-color: rgba(355, 355, 355, 0.8);
21+
bottom: 0;
22+
left: $menuWidth;
23+
right: 0;
24+
25+
.previous, .next {
26+
display: inline-block;
27+
padding: 15px 20px;
28+
text-decoration: none;
29+
position: absolute;
30+
top: 0;
31+
32+
i, span {
33+
display: inline-block;
34+
vertical-align: top;
35+
line-height: 20px;
36+
color: $primary;
37+
}
38+
i {
39+
font-size: 16px;
40+
}
41+
span {
42+
font-size: 15px;
43+
padding: 0 5px;
44+
}
45+
46+
&:hover {
47+
text-decoration: none;
48+
}
49+
}
50+
.previous {
51+
left: 0;
52+
}
53+
.next {
54+
right: 0;
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.index {
2+
margin: 10% auto;
3+
text-align: center;
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
.menu {
2+
position: fixed;
3+
top: 0;
4+
left: 0;
5+
bottom: 0;
6+
width: $menuWidth;
7+
border-right: 1px solid $bordersColor;
8+
}
9+
10+
.logo {
11+
text-align: center;
12+
padding: 20px 20px;
13+
font-size: 24px;
14+
line-height: 46px;
15+
font-weight: 300;
16+
color: #666666;
17+
}
18+
19+
.menu-nav {
20+
padding: 20px 25px;
21+
22+
span {
23+
color: #666666;
24+
font-size: 16px;
25+
font-weight: 600;
26+
}
27+
28+
a {
29+
display: block;
30+
color: #777777;
31+
font-size: 14px;
32+
font-weight: 400;
33+
line-height: 24px;
34+
text-decoration: none;
35+
padding: 6px 0;
36+
37+
&:hover {
38+
color: #333333;
39+
}
40+
&.active {
41+
color: $primary;
42+
}
43+
}
44+
45+
>.nav >li {
46+
margin-bottom: 20px;
47+
}
48+
49+
>.nav {
50+
padding: 0;
51+
}
52+
53+
.nav {
54+
list-style: none;
55+
.nav {
56+
padding-top: 10px;
57+
padding-bottom: 10px;
58+
padding-left: 20px;
59+
}
60+
}
61+
}
62+
63+
.footer {
64+
position: absolute;
65+
bottom: 0;
66+
left: 0;
67+
right: 0;
68+
padding: 15px 20px;
69+
text-align: center;
70+
border-top: 1px solid $bordersColor;
71+
display: block;
72+
text-decoration: none;
73+
74+
i, span {
75+
display: inline-block;
76+
vertical-align: top;
77+
line-height: 20px;
78+
color: #666666;
79+
}
80+
i {
81+
font-size: 17px;
82+
padding-right: 5px;
83+
}
84+
span {
85+
font-size: 14px;
86+
}
87+
88+
&:hover {
89+
text-decoration: none;
90+
i, span {
91+
color: $primary;
92+
}
93+
}
94+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
$highlightColor: #333333;
2+
$subColor: #444444;
3+
4+
h1 {
5+
border-bottom: 1px solid $bordersColor;
6+
margin-bottom: 30px;
7+
line-height: 50px;
8+
font-size: 34px;
9+
font-weight: 800;
10+
color: $highlightColor;
11+
}
12+
13+
h2 {
14+
font-size: 25px;
15+
font-weight: 600;
16+
color: $highlightColor;
17+
margin-bottom: 20px;
18+
margin-top: 30px;
19+
}
20+
21+
p, ul li {
22+
color: $subColor;
23+
font-size: 15px;
24+
line-height: 23px;
25+
}
26+
27+
a {
28+
color: $primary;
29+
30+
&:hover {
31+
color: darken($primary, 10%);
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Colors
2+
$bordersColor: #efefef;
3+
$primary: #10CF93;
4+
5+
// Sizes
6+
$menuWidth: 300px;
7+
8+
@import './_index';
9+
@import './_menu';
10+
@import './_content';
11+
@import './_typography';
12+
@import './_code';
13+
14+
body {
15+
font-family: 'Open Sans';
16+
}

0 commit comments

Comments
 (0)
Please sign in to comment.