以前在 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