本篇内容转自 litten.me
一、使用
1. 安装
1 | git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia |
2. 配置
修改hexo根目录下的 _config.yml : theme: yilia
3. 更新
1 | cd themes/yilia |
2 | git pull |
二、配置
主题配置文件在主目录下的_config.yml:
1 | # Header |
2 | menu: |
3 | 主页: / |
4 | 所有文章: /archives |
5 | # 旧事: /tags/旧事 |
6 | # SubNav |
7 | subnav: |
8 | github: "https://github.com/litten" |
9 | weibo: "http://weibo.com/litten225" |
10 | rss: "http://feed.feedsky.com/litten" |
11 | # facebook: "/" |
12 | # google: "/" |
13 | # twitter: "/" |
14 | # linkedin: "/" |
15 | rss: /atom.xml |
16 | # Content |
17 | excerpt_link: more |
18 | fancybox: true |
19 | # Miscellaneous |
20 | favicon: /favicon.png |
21 | avatar: "https://avatars2.githubusercontent.com/u/2024949?v=2&s=150" |
22 | share: true |
23 | duoshuo: true |
禁止评论可以通过修改你的.md文章的头部实现。设置comments:false即可。
三、 hexo指令集
Git Shell 在你的hexo
根目录下输入:hexo
可查看
1 | hexo # 查看帮助 |
2 | hexo help # 查看帮助 |
四、贴两份_config.yml
hexo根目录下的_config
1 | # Hexo Configuration |
2 | ## Docs: https://hexo.io/docs/configuration.html |
3 | ## Source: https://github.com/hexojs/hexo/ |
4 | |
5 | # Site #站点信息 |
6 | title: XElengo的个人博客 |
7 | subtitle: 从今天起,立志改变 |
8 | description: 我的个人学习&生活记录 |
9 | author: Xulinhu |
10 | email: 18838969833@163.com |
11 | keywords: "Java,Android,C#,HTML5" |
12 | language: zh-CN |
13 | timezone: |
14 | |
15 | # URL |
16 | ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' |
17 | url: https://xelengo.github.io/ |
18 | root: / |
19 | permalink: :year/:month/:day/:title/ |
20 | permalink_defaults: |
21 | |
22 | # Directory #目录 |
23 | source_dir: source |
24 | public_dir: public |
25 | tag_dir: tags |
26 | archive_dir: archives |
27 | category_dir: categories |
28 | code_dir: downloads/code |
29 | i18n_dir: :lang |
30 | skip_render: |
31 | |
32 | # Writing # 写作 |
33 | new_post_name: :title.md # File name of new posts |
34 | default_layout: post #默认模板(post page photo draft) |
35 | titlecase: false # Transform title into titlecase |
36 | external_link: true # Open external links in new tab |
37 | filename_case: 0 |
38 | render_drafts: false |
39 | post_asset_folder: false |
40 | relative_link: false |
41 | future: true |
42 | highlight: |
43 | enable: true |
44 | line_number: true |
45 | auto_detect: true |
46 | tab_replace: '' |
47 | |
48 | # Category & Tag #分类和标签 |
49 | default_category: uncategorized |
50 | category_map: |
51 | tag_map: |
52 | |
53 | # Archives |
54 | ## 2: Enable pagination |
55 | ## 1: Disable pagination |
56 | ## 0: Fully Disable |
57 | archive: 1 |
58 | category: 1 |
59 | tag: 1 |
60 | |
61 | # Date / Time format #日期时间格式 |
62 | ## Hexo uses Moment.js to parse and display date |
63 | ## You can customize the date format as defined in |
64 | ## http://momentjs.com/docs/#/displaying/format/ |
65 | date_format: YYYY-MM-DD |
66 | time_format: HH:mm:ss |
67 | |
68 | # Pagination #分页 |
69 | ## Set per_page to 0 to disable pagination |
70 | per_page: 10 |
71 | pagination_dir: page |
72 | |
73 | # Disqus #Disqus评论系统 |
74 | disqus_shortname: |
75 | |
76 | # Extensions #插件和主题 |
77 | ## Plugins: https://hexo.io/plugins/ |
78 | ## Themes: https://hexo.io/themes/ |
79 | theme: yilia |
80 | exclude_generator: |
81 | |
82 | feed: |
83 | type: atom |
84 | path: atom.xml |
85 | limit: 100 |
86 | |
87 | # Deployment #部署, 同时发布在 GitHub 和 GitCafe 上面 |
88 | ## Docs: https://hexo.io/docs/deployment.html |
89 | # deploy: |
90 | # type: git |
91 | # repository: https://github.com/xelengo/xelengo.github.io.git //jarson7426替换为你自己的用户名 |
92 | # branch: master |
93 | |
94 | # deploy: |
95 | # - type: git |
96 | # repo: [email protected]:username/username.git,gitcafe-pages |
97 | # - type: git |
98 | # repo: [email protected]:username/username.github.io.git,master |
99 | |
100 | # plugins: #插件,例如生成 RSS 和站点地图的 |
101 | # - hexo-generator-feed |
102 | # - hexo-generator-sitemap |
103 | |
104 | jsonContent: |
105 | meta: false |
106 | pages: false |
107 | posts: |
108 | title: true |
109 | date: true |
110 | path: true |
111 | text: true |
112 | raw: false |
113 | content: false |
114 | slug: false |
115 | updated: false |
116 | comments: false |
117 | link: false |
118 | permalink: false |
119 | excerpt: false |
120 | categories: false |
121 | tags: true |
yilia根目录下的_config
1 | # Hexo Configuration |
2 | ## Docs: https://hexo.io/docs/configuration.html |
3 | ## Source: https://github.com/hexojs/hexo/ |
4 | |
5 | # Site #站点信息 |
6 | title: XElengo的个人博客 |
7 | subtitle: 从今天起,立志改变 |
8 | description: 我的个人学习&生活记录 |
9 | author: Xulinhu |
10 | email: 18838969833@163.com |
11 | keywords: "Java,Android,C#,HTML5" |
12 | language: zh-CN |
13 | timezone: |
14 | |
15 | # URL |
16 | ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' |
17 | url: https://xelengo.github.io/ |
18 | root: / |
19 | permalink: :year/:month/:day/:title/ |
20 | permalink_defaults: |
21 | |
22 | # Directory #目录 |
23 | source_dir: source |
24 | public_dir: public |
25 | tag_dir: tags |
26 | archive_dir: archives |
27 | category_dir: categories |
28 | code_dir: downloads/code |
29 | i18n_dir: :lang |
30 | skip_render: |
31 | |
32 | # Writing # 写作 |
33 | new_post_name: :title.md # File name of new posts |
34 | default_layout: post #默认模板(post page photo draft) |
35 | titlecase: false # Transform title into titlecase |
36 | external_link: true # Open external links in new tab |
37 | filename_case: 0 |
38 | render_drafts: false |
39 | post_asset_folder: false |
40 | relative_link: false |
41 | future: true |
42 | highlight: |
43 | enable: true |
44 | line_number: true |
45 | auto_detect: true |
46 | tab_replace: '' |
47 | |
48 | # Category & Tag #分类和标签 |
49 | default_category: uncategorized |
50 | category_map: |
51 | tag_map: |
52 | |
53 | # Archives |
54 | ## 2: Enable pagination |
55 | ## 1: Disable pagination |
56 | ## 0: Fully Disable |
57 | archive: 1 |
58 | category: 1 |
59 | tag: 1 |
60 | |
61 | # Date / Time format #日期时间格式 |
62 | ## Hexo uses Moment.js to parse and display date |
63 | ## You can customize the date format as defined in |
64 | ## http://momentjs.com/docs/#/displaying/format/ |
65 | date_format: YYYY-MM-DD |
66 | time_format: HH:mm:ss |
67 | |
68 | # Pagination #分页 |
69 | ## Set per_page to 0 to disable pagination |
70 | per_page: 10 |
71 | pagination_dir: page |
72 | |
73 | # Disqus #Disqus评论系统 |
74 | disqus_shortname: |
75 | |
76 | # Extensions #插件和主题 |
77 | ## Plugins: https://hexo.io/plugins/ |
78 | ## Themes: https://hexo.io/themes/ |
79 | theme: yilia |
80 | exclude_generator: |
81 | |
82 | feed: |
83 | type: atom |
84 | path: atom.xml |
85 | limit: 100 |
86 | |
87 | # Deployment #部署, 同时发布在 GitHub 和 GitCafe 上面 |
88 | ## Docs: https://hexo.io/docs/deployment.html |
89 | # deploy: |
90 | # type: git |
91 | # repository: https://github.com/xelengo/xelengo.github.io.git //jarson7426替换为你自己的用户名 |
92 | # branch: master |
93 | |
94 | # deploy: |
95 | # - type: git |
96 | # repo: [email protected]:username/username.git,gitcafe-pages |
97 | # - type: git |
98 | # repo: [email protected]:username/username.github.io.git,master |
99 | |
100 | # plugins: #插件,例如生成 RSS 和站点地图的 |
101 | # - hexo-generator-feed |
102 | # - hexo-generator-sitemap |
103 | |
104 | jsonContent: |
105 | meta: false |
106 | pages: false |
107 | posts: |
108 | title: true |
109 | date: true |
110 | path: true |
111 | text: true |
112 | raw: false |
113 | content: false |
114 | slug: false |
115 | updated: false |
116 | comments: false |
117 | link: false |
118 | permalink: false |
119 | excerpt: false |
120 | categories: false |
121 | tags: true |