hexo-theme-indigo 主题

demo
hexo-theme-indigo

主题安装

安装需确认Hexo版本在 3.0 以上,以及Node版本在6.x以上,在Hexo根目录,执行以下命令:

git clone git@github.com:yscoder/hexo-theme-indigo.git themes/indigo

切换主题

在Hexo根目录下的_config.yml文件中修改,如下:

theme: indigo

注:记得保存。

依赖安装

Less

主题默认使用 less 作为 css 预处理工具。

npm install hexo-renderer-less --save

Feed

用于生成 rss。

npm install hexo-generator-feed --save

Json-content

用于生成静态站点数据,用作站内搜索的数据源。

npm install hexo-generator-json-content --save

QRCode(可选)

用于生成微信分享二维码。
可选,不安装时会请求 jiathis Api 生成二维码。

npm install hexo-helper-qrcode --save

开启分类页

仅 card theme 支持。

hexo new page categories

修改 hexo/source/categories/index.md 的元数据

layout: categories
comments: false
---

开启标签页

hexo new page tags

修改 hexo/source/tags/index.md 的元数据

layout: tags
comments: false
---

常见问题

文章截断

在Markdown中加

添加多个标签

tags: [a, b, c]

tags: 
  - a
  - b
  - c

分类

categories: [a, b, c]

更改站点配色

编辑 themes\indigo\source\css_partial\variable.less,更改对应的颜色变量。
配色参考:Material Design Color Palette Generator
注意:使用自定义配色时需把主题配置中的 cdn 关闭,cdn: false。

其他

参考:https://github.com/yscoder/hexo-theme-indigo/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98

站点配置

编辑站点配置文件 \themes\landscape_config.yml文件。

启动主题

theme: indigo

基本配置

左侧菜单

menu:
  home:
    text: 主页
    url: /
  archives:
    url: /archives
  tags:
    url: /tags
  github:
    url: https://github.com/yscoder
    target: _blank
  weibo:
    url: http://www.weibo.com/ysweb
    target: _blank
  link:
    text: 测试
    url: /

添加新菜单项时,在 menu 下增加子属性即可。属性说明如下:

menu:
 link:               # fontawesome图标,省略前缀,本主题前缀为 icon-,必须
   text: About       # 菜单显示的文字,如果省略即默认与图标一致,首字母会转大写
   url: /about       # 链接,绝对或相对路径,必须
   target: _blank    # 是否跳出,省略则在当前页面打开

favicon

站点 logo,显示在浏览器当前标签页左上角。

favicon: /favicon.ico

头像

位于左侧菜单上方

avatar: /img/logo.jpg

email

头像下方

email: 634206017@qq.com

color

设置 Android L Chrome 浏览器状态栏颜色,不需要可去除此项或设为 false。

color: '#3F51B5'

其他

参考:https://github.com/yscoder/hexo-theme-indigo/wiki/%E9%85%8D%E7%BD%AE