日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

使用hexo创建blog

發布時間:2025/3/15 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。