使用hexo创建blog
生活随笔
收集整理的這篇文章主要介紹了
使用hexo创建blog
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
安裝hexo
主要采用hexo工具本地生成技術知識庫預覽,hexo使用說明;
安裝hexo必須先安裝nodejs、npm:
| 1 | npm install hexo -g |
?
創建blog
創建一個blog目錄,進入其中執行:
| 1 2 3 4 5 6 7 8 9 10 11 | hexo init npm install --save hexo-filter-sequence npm install --save hexo-filter-flowchart npm install hexo-renderer-mathjax --save npm install --save hexo-generator-feed npm install hexo-filter-mermaid-diagrams --save npm install hexo-generator-search --save# 解決TOC出現undefine問題 npm install markdown-it-named-headings --save hexo clean hexo g |
?
編輯_config.yml添加以下內容:
| 1 2 3 4 5 6 7 8 9 10 11 12 | flowchart:options: # options used for `drawSVG`sequence:options: theme: css_class: mathjax:enable: true #修改主題 theme: next |
?
使用next主題,下載主題到themes中:
| 1 | git clone https://github.com/iissnan/hexo-theme-next themes/next |
?
讓next支持mermaid,在themes/next/layout/_partials/head/custom-head.swig中添加:
| 1 2 | <script src="{{ url_for('https://unpkg.com/mermaid@'+theme.mermaid.version + '/dist/mermaid.min.js') }}"></script> <script type="text/javascript">mermaid.initialize({startOnLoad:true,flowchart:{useMaxWidth:false, htmlLabels:true}});</script> |
?
支持本地搜索,編輯thmem
| 1 2 | local_search:enable: true #默認為false |
?
創建tags、categories:
| 1 2 | hexo new page tags hexo new page categories |
?
編輯source/tags/index.md,改為:
| 1 2 3 4 | title: 標簽 date: 日期 type: "tags" comments: false |
?
編輯source/categories/index.md,改為:
| 1 2 3 4 | title: 分類 date: 日期 type: "categories" comments: false |
?
將技術知識庫倉庫checkout,
| 1 | svn co http://192.168.7.3/svn/drops |
?
復制drops下的文件內容到?blog/source/_posts/目錄下;
| 1 | cp -rf drops /blog/source/_posts/ |
?
執行hexo s啟動本地服務,通過該方式進行預覽。
使用hexo生成md文件:
| 1 | hexo new "文章標題" |
?
該動作會直接執行文件創建,會在source/_post/下生成一個”文章標題.md”的文件。
總結
以上是生活随笔為你收集整理的使用hexo创建blog的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 10. OD-VC程序暴力破解
- 下一篇: Linux无线网卡的工作模式