以前在 Gitbook 上建立了一个 FAQ 网站,可是 Gitbook 使用起来偏麻烦,并且主题很差看。预期建立一个 Gitbook 主题,不如建立一个 Hexo 主题,而后将网站部署到 Github 上。因而我便动手制做了这个主题。git
这个主题的最初目的是为了服务这个网站 Swift Newbie: 给 Swift 新手的知识库,对 Swift 学习感兴趣的同窗能够点开看看,有意贡献的同窗能够联系我
hi@chengkang.me
。github项目主页:《Theme QnA for Hexo》npm
为 Hexo 设计的『知识库』类主题。bash
$ git clone https://github.com/cheng-kang/hexo-theme-qna.git themes/QnA
修改根目录中 _config.yml
的 theme
为 QnA。
url
cd themes/QnA git pull
安装 Hexo 插件 hexo-deployer-git。spa
$ npm install hexo-deployer-git --save
编辑你 Hexo 博客根目录中的 _config.yml
文件。插件
deploy: type: git repo: <repository url> # https://github.com/cheng-kang/hexo-theme-qna.git branch: [branch] # master
QnA 默认只支持英文站内搜索。
安装 Hexo 插件 hexo-generator-search。
$ npm install hexo-generator-search --save
添加一个新页面,例如:about 页面。改变页面内容请修改根目录下 source/about/index.md 文件。
$ hexo new page about
编辑 theme/QnA 中的 _config.yml
。
menu: Home: / Archive: /archives # Add new page config here # Page Dispay Name: /pagename # e.g. About: /about