简述: 之前的电脑系统出了点问题,电脑一直连不上网,无奈之下去重装了一个系统,然后之前的hexo文件夹就都找不到啦,所以特地写下这个文章来记录一下,方便以后查看。

本文初发于 “曾晨de小站” zengchen233.cn,同步转载于此。

文件夹详细配置:

在/themes文件夹下clone
git clone -b master https://github.com/YunYouJun/hexo-theme-yun themes/yun  # 后续升级使用 dev 分支
npm install hexo-render-pug hexo-renderer-stylus



配置 yun 主题细节

npm install hexo-generator-tag  # 安装标签 tags : hexo-generator-tag
hexo new page tags              # 生成之后替换 

---------- 修改 source/tags/index.md 的 Front Matter ----------

---

date: 2017-10-09 19:11:58
comments: false

type: tags



---------- yun/_config.yml 设置如下 ----------

wordcloud:                      # 标签云(词云)
  enable: true
  height: 350



打赏二维码:替换文本即可 reward

编辑链接:替换文本即可 post_edit

运行时间:替换文本即可 live_time

关闭留言跳转 GitHub Issues:替换文本即可 Comments





npm install hexo-wordcount      # 字数统计

---------- yun/_config.yml 设置如下 ----------

wordcount:
  enable: true
  count: true
  time: true





npm install hexo-generator-search --save     # 开启本地搜索

---------- yun/_config.yml 设置如下 ----------

local_search:
  enable: true
  src: /js/search/local-search.js





谷歌广告:替换文本,不开启 Google Adsense 

谷歌搜索:替换文本即可 google_analytics





npm install hexo-prism-plugin  # 代码高亮

---------- 💘 需要新增 💘 hexo/_config.yml 设置如下 ----------

prism_plugin:
  mode: preprocess # realtime/preprocess
  theme: default
  line_number: false # default false

custom_css: "path/to/your/custom.css" # optional

顺带关闭 hexo/_config.yml 自带的高亮  

highlight:
  enable: false





npm install hexo-generator-feed --save # RSS 安装

---------- yun/_config.yml 设置如下 (但我没有修改) ----------

social:

  - name: RSS
    link: /atom.xml # config.feed.path
    icon: icon-rss-line
    color: orange





npm uninstall hexo-generator-index --save         # 文章置顶: 文章头部添加 top: true 即可
npm install hexo-generator-index-pin-top --save





npm install hexo-abbrlink --save                   # 文章短链接

---------- 💘 需要新增 💘 hexo/_config.yml 设置如下 ----------

URL

If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'

url: http://yoursite.com
root: /

permalink: :year/:month/:day/:title/  # 旧的注释掉

permalink_defaults:                   # 旧的注释掉

permalink: posts/:abbrlink/
abbrlink:
  alg: crc32 #support crc16(default) and crc32
  rep: hex #support dec(default) and hex
  drafts: false #(true)Process draft,(false)Do not process draft

Generate categories from directory-tree

depth: the max_depth of directory-tree you want to generate, should > 0

  auto_category:
    enable: false #默认为 true, 手改改为 false
    depth:

参考