hexo-theme-Wikitten

文章目录
  1. 1. hexo-theme-Wikitten
    1. 1.0.1. 一个仿 Wikitten 样式的 Hexo 个人 wiki 系统主题。 >预览
  2. 1.1. 安装说明
    1. 1.1.1. 安装
    2. 1.1.2. 启用
    3. 1.1.3. 更新
  3. 1.2. 配置说明
    1. 1.2.1. profile、comment、Share 和 miscellaneous 项都是 默认关闭的!
  • hexo-theme-Wikitten

    English Page

    一个仿 Wikitten 样式的 Hexo 个人 wiki 系统主题。 >预览

    一些特性:

    • 适用于个人 wiki 知识管理
    • 简洁,双栏,分类
    • 将知识多级分类整理,侧边分级展开,为思维跳转设计
    • 根据文件路径自动为文章添加分类 #4

    Site Preview

    mobile preview mobile preview

    安装说明

    hexo-theme-Wikitten 核心功能代码基于 icarus,所以你可以在 icarus wiki 阅读基础功能文档。

    安装

    注意:本主题需要 Hexo v3.6 及以上版本。

    1. 进入你的 hexo 站点文件夹,克隆 Wikitten 主题到 themes/ 路径下
    1
    2
    3
    >   $ cd your-hexo-directory
    > $ git clone https://github.com/zthxxx/hexo-theme-Wikitten.git themes/Wikitten
    >
  1. 覆盖站点目录中一些默认页面模板

    1
    2
    3
    >   $ cp -rf themes/Wikitten/_source/* source/
    > $ cp -rf themes/Wikitten/_scaffolds/* scaffolds/
    >
  1. 重命名主题中的 _config.yml.example_config.yml,然后可以使用配置文件配置主题

    1
    2
    3
    4
    >   $ cp -f themes/Wikitten/_config.yml.example themes/Wikitten/_config.yml
    > # 编辑配置文件,定制你的配置项
    > $ vim themes/Wikitten/_config.yml
    >

大部分的配置项都和 icarus 主题中的配置项一样,你可以首先去阅读一下 icraus 的文档

一些你可以开箱即用的推荐配置见下面的文档:#Configuration

  1. 需要安装的插件写在主题的 package.json 文件中

    这里列出了这些插件的功能作用:

    1
    2
    3
    4
    5
    6
    >   hexo-autonofollow	    // 打开非本站链接时自动开启新标签页
    > hexo-directory-category // 根据文章文件目录自动为文章添加分类
    > hexo-generator-feed // 生成 RSS 源
    > hexo-generator-json-content // 生成全站文章 json 内容,用于全文搜索
    > hexo-generator-sitemap // 生成全站站点地图 sitemap
    >

你可以将这些插件合并到站点package.json 文件中通过 npm install 一次安装,

或者在站点目录下,你可以通过以下命令安装他们:

1
2
>   $ npm i -S hexo-autonofollow hexo-directory-category hexo-generator-feed hexo-generator-json-content hexo-generator-sitemap
>

启用

修改站点 _config.yml 文件中的 theme 选项为 Wikitten

更新

1
2
3
>   $ cd themes/Wikitten
> $ git pull origin master
>

配置说明

在站点配置文件 _config.yml 中, 推荐配置为

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
>   # Hexo Configuration
> # URL
> permalink: wiki/:title/
>
> # Directory
> skip_render:
> - README.md
> - '_posts/**/embed_page/**'
>
> # Writing
> new_post_name: :title.md # File name of new posts
>
> ## Markdown
> ## https://github.com/hexojs/hexo-renderer-marked
> marked:
> gfm: true
>
> ## Plugins: https://hexo.io/plugins/
> ### JsonContent
> jsonContent:
> meta: false
> pages:
> title: true
> date: true
> path: true
> text: true
> posts:
> title: true
> date: true
> path: true
> text: true
> tags: true
> categories: true
> ignore:
> - 404.html
>
> ### Creat sitemap
> sitemap:
> path: sitemap.xml
>
> ### Adds nofollow attribute to all external links in your hexo blog posts automatically.
> nofollow:
> enable: true
> exclude:
> - <your site url domain> # eg: zthxxx.me
>

主题配置文件 Wikitten/_config.yml 中,你能阅读到各个选项更多的细节配置。

在开始之前,首先请将主题配置文件示例中「我」的信息修改为「你」自己的信息,其中包括 profile social_linkshistory_control等配置项。

profilecommentSharemiscellaneous 项都是 默认关闭的

(你任然可以打开那些选项,只是不推荐这样做。)

其他的 推荐设置为

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
>   # Customize
> customize: # 首先修改这项里面的信息为你自己的各项信息
> sidebar: left # 侧边栏的所在位置,默认左边
> category_perExpand: false # 侧边栏里的各个分类是否默认全部展开
> default_index_file: index.md # 是否指定一篇文章作为首页来代替默认的多篇文章的首页,没有此项的话就会显示默认的按时间顺序排列的文章
>
> # Widgets
> widgets: # 挂件,默认指开启了分类这一栏
> - category
> # - recent_posts
> # - archive
> # - tag
> # - tagcloud
> # - links
>
> # History version
> history_control: # 启用这一项使得 wiki 能有历史版本的功能(查看源码、在线编辑、对比历史变动)
> enable: true
> server_link: https://github.com # 版本控制服务器,推荐使用 GitHub https://github.com
> user: <your GitHub name>
> repertory: <your repertory name of this wiki source code>
> branch: <branch name of this wiki site source code>
>

GitHub地址:https://github.com/zthxxx/hexo-theme-Wikitten/blob/master/README_zh-CN.md#Configuration