本主题 fork 自 cactus 主题,项目主页。主题最新版请从原作者处下载,本主题仅做风格上的修改和部分 bug 修复。
fork
版本:3.0
主题默认修改为白色,其中所有的修改也是基于白色主题修改的,在其他颜色方案上未做测试。
- の
- 修复部分 bug
- の
- 添加搜索页面
- の
- 添加 分类页 和 标签页,可在 主题配置 文件中的 nav 选项中控制
- の
- 修改 bash 命令行样式
- の
- 添加 live2d 控件
- 增添部分样式
- 增添
danger类
警告窗样式
- の
- 解决无法添加文章列表页的 bug
新添标签云页面
- の
- 修改
code
代码块样式 - 分离
pre
代码块样式 - 添加
highlight
高亮方案avue.css
,样式为 vue 官网风格
- 修改
------------------------------------ 我是分割线 ------------------------------------
-
下载主题文件:
$ git clone https://github.com/Mrcxt/xiabibi-cactus.git
-
将主题文件放入
themes
文件夹中 -
在
config.yml
中修改theme
.# theme: landscape theme: xiabibi-cactus
-
运行命令
hexo server -d
查看效果吧
具体配置请参照 live2d 项目
你可以修改_config.yml
文件来自定义配置
注意:这里有两种方式来修改。hexo 下的_config.yml
和主题下的_config.yml
,前者将覆盖后者的变量。
For example:
# _config.yml
theme_config:
colorscheme: white
# themes/cactus/_config.yml
colorscheme: dark
这将导致主题为白色
你也可以创建新的颜色方案source/css/_colors
.
Setup the navigation menu in the _config.yml
:
nav:
Home: /
About: /about/
Writing: /archives/
Projects: URL
LINK_NAME: URL
你可以决定显示多少条文章在你的首页
-
只显示最近的 10 条内容
posts_overview: show_all_posts: false post_count: 10
-
显示全部文章
posts_overview: show_all_posts: true
可以通过自source/_data/projects.json
来展示项目列表,注意是 hexo 下的 source 文件夹,而非主题文件下。
[
{
"name": "Hexo",
"url": "https://hexo.io/",
"desc": "A fast, simple & powerful blog framework"
},
{
"name": "Font Awesome",
"url": "http://fontawesome.io/",
"desc": "The iconic font and CSS toolkit"
}
]
Cactus can automatically add links to your social media accounts.
Therefore, update the theme's _config.yml
:
social_links:
github: your-github-url
twitter: your-twitter-url
NAME: your-NAME-url
where NAME
is the name of a Font Awesome icon.
If you are new to Hexo and internationalization (i18n), please read Hexo documentation - internationalization (i18n) section
Currently, the theme is delivered with support for:
- English (en), default
- Chinese (Simplified, PRC) (zh-CN)
- Dutch (nl)
- French (fr)
- Persian (fa)
- Russian (ru)
- Spanish (es)
If you would like to use one the languages listed above, simply set language
to the desired language (e.g., fr
) in _config.yml
.
Otherwise, you can follow the steps below (E.g., to add a Japanese (ja) translation):
- Set
language
toja
in Hexo configuration file_config.yml
- Create a
ja.yml
file in thethemes/cactus/languages/
folder - Copy the content of
themes/cactus/languages/default.yml
and paste it it into theja.yml
file - Replace all English strings by their Japanese translation
Note: Cactus does not support multi-language sites.
Set the rss
field in the _config.yml
to one of the following values:
rss: false
will totally disable rss (default).rss: atom.xml
sets a specific feed link.rss:
leave empty to use the hexo-generator-feed plugin.
Add you Google Analytics or Baidu Tongji tracking_id
to the _config.yml
.
google_analytics:
enabled: true
id: 'UA-49627206-1'
baidu_analytics:
enabled: true
id: 2e6da3c375c8a87f5b664cea6d4cb29c
First, create a site on Disqus: https://disqus.com/admin/create/.
Next, update the _config.yml
file:
disqus:
enabled: true
shortname: SITENAME
where SITENAME
is the name you gave your site on Disqus.
Pick one of the available colorschemes and add it to the _config.yml
:
highlight: COLORSCHEME_NAME
First, install the hexo-generate-search plugin, which will generate a search index file.
$ npm install hexo-generator-search --save
Next, create a page to display the search engine:
$ hexo new page Search
and put search: true
in the front-matter.
Finally, edit the _config.yml
and add a link to the navigation menu.
nav:
search: /Search/
MIT