Hexo-Theme-freemind.bithack

screenshot

修改自hexo-theme-freemin.386 更改了原来的配色和英文字体,添加了对waline/valine/gitalk评论系统的支持

哦还改了386作者留下的无数个bug,之前甚至都没察觉
Fixed Bugs:

  • Markdown 多级标题失效(原三级以下的标题全部和二级一样大小)
  • 首页预览隐藏了二三级标题(但是一四五级就能显示,我还找了半天entry.ejs的问题,结果他妈在css里被隐藏了,无语)
  • 三级标题两边多了个【】
  • 斜体失效 (不仅失效,开头还多了个/)
  • 粗体失效

我不会前端和Node,所有的修改都是自己踩坑摸索出来的,想给这个主题添加新功能的话可以提交PR

安装

  1. 安装 主题:
1
$ git clone git@github.com:Ares-X/hexo-theme-freemind.bithack themes/freemind.bithack
  1. 安装 hexo-tag-bootstrap (optional):
1
$ npm install hexo-tag-bootstrap --save
  1. 安装 hexo-generator-search (necessary)
1
$ npm install hexo-generator-search --save

4)安装hexo-excerpt (must)

1
npm install hexo-excerpt --save

5)创建页面
Freemind.bithack 预先定义了 Categories(分类)、Tags(标签) 和 About(关于)页面,要使用它们,你需要先在你的博客的 source 目录中添加相应页面。
例如,要创建 Categories 页面,在终端上:

1
$ hexo new page catergories

然后记得修改layout为对应的页面样式

1
2
3
title: Categories
layout: categories
---

启用

  1. 修改 _config.yml 文件里的 theme 选项为 freemind.bithack
  2. 复制主题下的配置文件到hexo根目录 cp themes/freemind.bithack/_config.yml ./_config.freemind.bithack.yml

配置

Theme Config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
slogan: "wubba lubba dub dub."

show_heart: true

show_slogan: true

menu:
- title: Archives
url: archives
intro: "All the articles."
# icon: "fa fa-archive"
- title: Categories
url: categories
intro: "All the categories."
# icon: "fa fa-folder"
- title: Tags
url: tags
intro: "All the tags."
# icon: "fa fa-tags"
- title: About
url: about
intro: "About me."
# icon: "fa fa-user"
- title: RSS
url: atom.xml
intro: "Subscribe me."
# icon: "fa fa-user"

links:
- title: hexo-theme-bithack
url: https://github.com/Ares-X/hexo-theme-freemind.bithack
intro: ""
icon: false

# - title: "My LinkedIn"
# url: http://www.linkedin.com/in/xxx
# intro: "My Linkin account."
# icon: "fa fa-linkedin"

widgets:
- search
- category
- tagcloud
- recent_posts
- links

rss: atom.xml
fancybox: true
favicon: favicon.png
#duoshuo_shortname:


# Analytics (change to yours)
google_analytics:
enable: true
siteid: UA-70812759-1


# search
#swiftype_key: ZP2ZSuHgipSZfRyU8uTR

#valine comment (change to yours)
# doc: https://valine.js.org/en/hexo.html
valine:
enable: false
appId: 'xxx'
appKey: 'xxx'
placeholder: ""
visitor: true
avatar: 'monsterid'
requiredFields: ['nick','mail']
pageView: false

#waline comment (change to yours)
# doc: https://waline.js.org/
waline:
enable: false
serverURL: ''
pageview: false
lang: en
dark: true
requiredMeta: ['nick', 'mail']
locale:
placeholder: 'Comment with Email address will get notification when replied'
# gitalk comment (change to yours)
# doc: https://github.com/gitalk/gitalk
gitalk:
enable: false
clientID: ''
clientSecret: ''
repo: ''
owner: ''
admin: ['']
id: location.pathname # It is recommended not to change
distractionFreeMode: true

Hexo Config

hexo配置文件(非主题配置文件)中添加:

1
2
3
4
5
6
category_generator:
per_page: 0

tag_generator:
per_page: 0

否则进入单个标题或标签的页面只会显示10条内容

hexo配置文件(非主题配置文件)中启用 prismjs

1
2
3
4
5
6
7
8
9
10
11
12
13
# enable prismjs
highlight:
enable: false
line_number: true
auto_detect: false
tab_replace: ''
wrap: true
hljs: false
prismjs:
enable: true
preprocess: true
line_number: true
tab_replace: ''

hexo配置文件(非主题配置文件)中添加

1
2
3
4
5
excerpt:
depth: 10
excerpt_excludes: []
more_excludes: []
hideWholePostExcerpts: true

可调整默认文章摘要长度

hexo/source 中创建favicon.png 可修改默认logo

版权信息

修改 \layout\_partial\post\copyright.ejs 文件中的内容即可

1
2
3
4
5
<div class="article-footer-copyright">

本博客采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank">知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议(CC BY-NC-SA 4.0) 发布.
</div>

Front-Matter

文章配置

  • description - 简介
  • feature - 设置预览图
  • toc - 启用toc

For example:

1
2
3
4
5
6
7
8
title: Tag Plugins
date: 2014-03-16 10:17:16
tags: plugins
categories: Docs
description: Introduce tag plugins in freemind.
feature: images/tag-plugins/plugins.jpg
toc: true
---
⬆︎TOP