Snippet主题配置

下文以$BLOG_HOME表示你的博客根目录 打开$BLOG_HOME/themes/snippet_config.yml,

导航菜单配置

menu:
- page: home
  url: /
  icon: fa-home

说明:page:名字/多语言支持/,url:访问地址,icon:引用的fontawesome字体图标

网站图标位置

favicon: /favicon.ico

rss文件位置

rss: /atom.xml

通用时间格式化

date_format: YYYY-MM-DD HH:mm:ss

widgets -- 6个右边小工具

widgets:

  • notification
  • social
  • category
  • archive
  • tagcloud
  • friends

各个小工具的设置

notification config --网站公告设置,支持 html 和 纯文本

notification: |- 
            <p>主题Snippet v1.1.0版本已经上线!欢迎更新~ <br/>
            主题下载:<a href="https://github.com/shenliyang/hexo-theme-snippet" title="fork me" target="_blank">Snippet主题</a> <br/>
            <hr/>接受贡献,包括不限于提交问题与需求,修复代码。欢迎Pull Request。<br/>支持主题:<a href="https://github.com/shenliyang/hexo-theme-snippet/stargazers">Star一下</a></p>

社交设置

social:
 - name: Github
   icon: git
   href: //github.com/shenliyang
 - name: 邮箱
   icon: envelope-o
   href: mailto:snippet@91h5.cc
 - name: 联系QQ
   icon: qq
   href: /
 - name: 微博
   icon: weibo
   href: /
 - name: QQ群
   icon: users
   href: /
 - name: RSS
   icon: feed
   href: /atom.xml

说明:name:社交工具名字,icon:社交工具图标,href:设置工具链接,参考图标

文章分类设置

cate_config:
   show_count: true
   show_current: true

说明:show_count:是否显示数字,show_current: 是否高亮当前category

文章归档设置

arch_config:
   type: 'monthly'
   show_count: true
   order: -1

参数参考

彩色标签云设置

tagcloud_config:
   min_font: 1
   max_font: 1
   unit: em
   amount: 100
   color: true
   orderby: 'count'

参数参考

友链设置

links:
- 主题作者: http://www.shenliyang.com

自定义内容设置

添加版权保护

archiveCopyright:
  enable: true
  tip: '商业转载请联系作者获得授权,非商业转载请注明出处 © Snippet'

说明:enable:是否开启,tip:提示信息

当无目录时的显示文字,默认为'无'

noCategoryText: '无'

过低版本的浏览器提醒文字

outdated_browser_text: '你使用的浏览器版本过低,为了你更好的阅读体验,请更新浏览器的版本或者使用其他现代浏览器,比如Chrome、Firefox、Safari等。'

文章过期提醒功能

warning:
  days: 300 
  text: '本文于%d天之前发表,文中内容可能已经过时。'

说明:days:临界天数,text:提醒文字/%d为过期总天数占位符/

首页文章缩略图

加载规则: 自定义文章缩略图(在Front-matter中添加的'img'字段) > 文章内的图片 > defaultImgs(随机获取) > 无图模式列表

## 自定义随机图片
defaultImgs:
  - http://www.example.jpg //远程图片链接样例
  - /img/default-1.jpg //本地图片链接样例

懒加载图片占位符

placeholder: /img/loading.gif //为了友好,不建议改动

截取文章首页描述字数

excerptLength: 120 //首页文章描述要截取的数量

代码高亮配置

可配置主题名称[default,github,foundation,googlecode,monokai-sublime,monokai,monokai,xcode,vs2015,tomorrow,hybrid] 参考网站

highlightTheme: default

版权声明文字

支持html/text,但不要使用<li>标签

cc: |-
      <a href="https://creativecommons.org/licenses/by-nc-nd/3.0/" target="_blank">
      知识共享署名-非商业性使用-禁止演绎 3.0 未本地化版本许可协议(CC BY-NC-ND 3.0)
      </a>

主题评论

gitment

gitment:
  enable: false
  owner: 
  repo: 
  client_id: 
  client_secret: 
  labels: 
  perPage: 
  maxCommentHeight:

友言评论(默认选项)

uyan:
  enable: true
  uyan_id:

网盟CNZZ网站统计

cnzz_anaylytics:

参考网站:http://www.umeng.com/

百度网站统计

baidu_anaylytics:

参考网站: https://tongji.baidu.com

百度文章推送

baidu_push:

参考网站: http://zhanzhang.baidu.com

ICON配置 (不配则启用本地Font Icon)

fontAwesome: //cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css

网站主题配置

since: 2017
robot: 'all' ### 控制搜索引擎的抓取和索引编制行为,默认为all,搜索 `meta name="robots"` 或请参考: https://support.google.com/webmasters/answer/79812?hl=zh-Hans
version: 1.1.0

results matching ""

    No results matching ""