Jianghc's Blog

Back

写在前面的#

这里对于主目录下的_config.yaml文件的相关的配置说明,一般来说Hexo当中有两个主要的配置文件,其名称均为_config.yml,它们均是用于站点配置使用的。一份位于站点的根目录下(D:\blog_config.yml),主要包含 Hexo 本身整站的配置,另一部分通常位主题目录下(D:\blog\themes\yilia-plus_config.yml)。由作者主题提供相应的配置选项。

修改配置文件时应该注意的点:#

  1. 建议使用sublime或者atom等方式去编辑,不要使用Windows自带的记事本(产生中文乱码请修改文件编码格式为UTF-8)
  2. 不要忽略了冒号后面的空格,以及特殊符号后的空格和段落之间的换行分隔

主目录配置文件中可设置功能#

1、网站#

参数描述
title网站标题
subtitle网站副标题
description网站描述
author您的名字
language网站使用的语言
timezone网站时区。Hexo 默认使用您电脑的时区。时区列表。比如说:America/New_York,Japan, 和 UTC 。

2、网址#

参数描述规格
url网址
root网站根目录
permalink文章的 永久链接 格式:year/:month/:day/:title/
permalink_default永久链接中各部分的默认值

3、目录#

参数描述默认值
source_dir资源文件夹,这个文件夹用来存放内容。source
public_dir公共文件夹,这个文件夹用于存放生成的站点文件。public
tag_dir标签文件夹tags
archive_dir归档文件夹archives
category_dir分类文件夹categories
code_dirInclude code 文件夹downloads/code
i18n_dir国际化(i18n)文件夹:lang

4、文章#

参数描述默认值
new_post_name新文章的文件名称:title.md
default_layout预设布局post
auto_spacing在中文和英文之间加入空格false
titlecase把标题转换为 title casefalse
external_link在新标签中打开链接true
filename_case把文件名称转换为 (1) 小写或 (2) 大写0
render_drafts显示草稿false
post_asset_folder启动 Asset 文件夹false
relative_link把链接改为与根目录的相对位址false
future显示未来的文章true
highlight代码块的设置

5、分类 & 标签#

参数描述默认值
default_category默认分类uncategorized
category_map分类别名
tag_map标签别名

6、(日期-时间格式)日期 / 时间格式#

Hexo 使用 Moment.js 来解析和显示时间。

参数描述默认值
date_format日期格式YYYY-MM-DD
time_format时间格式H:mm:ss

7、分页#

参数描述默认值
per_page每页显示的文章量 (0 = 关闭分页功能)10
pagination_dir分页目录page

8、扩展#

参数描述
theme当前主题名称。值为false时禁用主题
deploy部署部分的设置

主题目录配置文件中的相关功能#

目前我个人的一些相关配置

## Header-菜单
menu:
  主页: /
  相册: /photos

## subNav-导航
subNav:
  github: "https://github.com/jhch1995"
  #gitee: "#" # 码云
  #jianshu: "#" #简书
  #csdn: "#"
  #rss: "#"
  #zhihu: "#"
  qq: "img/694459065.jpg"
  weixin: "img/weixin.jpg"
  #weibo: "#"
  #douban: "#"
  #segmentfault: "#"
  #bilibili: "#"
  #acfun: "#"
  #mail: "mailto:[email protected]"
  #facebook: "#"
  #google: "#"
  #twitter: "#"
  #linkedin: "#"

## 悬停预览图片效果
hover_effect:
  ## `global` 0: Set separately, 1: Enable global 2: Close global
  ## `global` 0: 分开设置, 1: 全局启用, 2: 全局关闭
  global: 1
  # SubNav-导航
  subNav: true

## RSS订阅(关于如何配置启用:https://www.jianshu.com/p/2aaac7a19736)
rss: /atom.xml

## 是否需要修改 root 路径
## 如果您的网站存放在子目录中,例如 http://yoursite.com/blog,
## 请将您的 url 设为 http://yoursite.com/blog 并把 / 设为 /blog/。
url: 47.103.26.197
root: /

## Content

## 文章太长,截断按钮文字
excerpt_link: more
## 文章卡片右下角常驻链接,不需要请设置为false
show_all_link: '展开全文'
## 数学公式
mathjax: false

## Open link in a new tab | 是否在新窗口打开链接
open_in_new:
  article: true  # 文章链接
  menu: true   # 导航菜单
  subNav: true  # 子菜单

## 打赏
## 打赏type设定:0-关闭打赏; 1-文章对应的md文件里有reward:true属性,才有打赏; 2-所有文章均有打赏
reward_type: 2
## 打赏wording
reward_wording: '感谢你的阅读和支持'
## 支付宝二维码图片地址,跟你设置头像的方式一样。比如:/assets/img/alipay.jpg
alipay: /img/alipay.png
## 微信二维码图片地址
weixin: /img/wxreward.png

## 目录
## 目录设定:0-不显示目录; 1-文章对应的md文件里有toc:true属性,才有目录; 2-所有文章均显示目录
toc: 1
## 根据自己的习惯来设置,如果你的目录标题习惯有标号,置为true即可隐藏hexo重复的序号;否则置为false
toc_hide_index: false
## 目录为空时的提示
toc_empty_wording: '目录,不存在的…'

## 是否有快速回到顶部的按钮
top: true

## Miscellaneous
## 百度统计
baidu_analytics: ''
google_analytics: ''

## 网站图标
favicon: /favicon.ico

## 你的头像url
avatar: /img/head.jpg

## 是否开启分享
share_jia: true

## 评论:1、畅言;2、Disqus;3、Gitment;4、Giteement
## 不需要使用某项,直接设置值为false,或注释掉
## 具体请参考wiki:https://github.com/JoeyBling/hexo-theme-yilia-plus/wiki

## 1、畅言
changyan_appid: false
changyan_conf: false

## 2、Disqus 在hexo根目录的config里也有disqus_shortname字段,优先使用yilia-plus的
disqus: false

## 3、Gitment----基于GitHub的评论系统(关闭请设置gitment_owner为false)
## 关于如何集成:https://www.jianshu.com/p/ac7658cc912f
gitment_owner: false      #你的 GitHub ID
## 是否使用官方js(false可以提升访问速度,本地修改过一部分的js,官方js可能会出现服务器不稳定,不太建议使用)
gitment_remote: false
gitment_repo: ''          #存储评论的 repo name(需要在Github创建)
gitment_oauth:
  client_id: ''           #client ID
  client_secret: ''       #client secret

## 4、Giteement----【国内用户建议使用这个,相对比较快】
## 关于如何集成:https://www.jianshu.com/p/f5c4633524c7
## 基于码云的评论系统(https://gitee.com/zhousiwei/giteement)
giteement:
  enable: false  # 是否启用码云评论系统
  # 是否使用官方js(false可以提升访问速度)
  remote: false
  redirect_uri: ''   # 应用回调地址(请和配置的第三方应用保持一致)
  # 不能更改(网上开源项目https://github.com/Rob--W/cors-anywhere作者提供的专门用来跨域服务器的配置)
  oauth_uri: https://cors-anywhere.herokuapp.com/https://gitee.com/oauth/token
  giteeID: ''  # 你的码云账号英文名
  # 存储评论的 repo name(需要在码云仓库创建公开仓库)
  repo: ''
  gitment_oauth:
    client_id: ''           #client ID
    client_secret: ''       #client secret

## 访问量统计功能(不蒜子)
busuanzi:
  enable: true
  site_visit: true  # 站点访问量显示
  article_visit: true  # 文章访问量显示


## 网易云音乐插件
music:
  enable: false
  # 播放器尺寸类型(1:长尺寸、2:短尺寸)
  type: 2
  #id: 1332647902  # 网易云分享的音乐ID(更换音乐请更改此配置项)
  autoPlay: true  # 是否开启自动播放
  # 提示文本(关闭请设置为false)
  text: '这似乎是首纯音乐,请尽情的欣赏它吧!'

## 页面点击小红心
clickLove:
  # (关闭请设置为false)
  enable: false

## GitHub Ribbons(https://github.blog/2008-12-19-github-ribbons/)
github:
  # (关闭请设置为false)
  url: https://github.com/jhch1995

## 页脚 Litten(此配置项已弃用)
## 帮助我们让更多人可以更方便使用Hexo,请尽量不要修改此主题配置
#pageFooter:
##  litten: GitHub:<a href="https://github.com/JoeyBling/hexo-theme-yilia-plus" target="_blank">hexo-theme-yilia-plus</a>

## 开启百度站长平台主动推送(https://ziyuan.baidu.com/linksubmit/index)
baidu_push: false

## 版权声明
## 版权声明type设定:0-关闭版权声明; 1-文章对应的md文件里有copyright: true属性,才有版权声明; 2-所有文章均有版权声明
copyright_type: 2

## 网站成立年份(默认为 2018,若填入年份小于当前年份,则显示为 2018-2019 类似的格式)
since: 2019

## Progress Bar | 页面加载进度条
## Demo: http://github.hubspot.com/pace/docs/welcome/
## type: barber-shop|big-counter|bounce|center-atom|center-circle|
##       center-radar|center-simple|corner-indicator|flash|flat-top|
##       loading-bar|mac-osx|minimal
## color: black|blue|green|orange|pink|purple|red|silver|white|yellow|
progressBar:
  enable: true
  type: 'minimal'  # Keep Quotes | 保留引号避免出错(某些type会导致样式重叠排版错误)
  color: blue

## Apple Touch icon 苹果图标(关闭请设置为false)
apple_touch_icon: '/apple-touch-icon-180x180.png'

## Tab Title Change | 标签页标题切换
tab_title_change:
  enable: true
  left_tab_title: '(つェ⊂) 我藏好了哦~ '
  return_tab_title: '(*´∇`*) 被你发现啦~ '

## 是否开启字数统计(关闭请设置enable为false)
## https://github.com/willin/hexo-wordcount
## 必须安装 `hexo-wordcount` 插件,在根目录执行 `npm i hexo-wordcount --save`
## 也可以单独在md文件里Front-matter设置`no_word_count: true`属性,来自定义关闭字数统计
word_count:
  enable: true
  # 只在文章详情显示(不在首页显示)
  only_article_visit: true

## 文字输入特效
## https://github.com/disjukr/activate-power-mode
activate_power_mode:
  enable: true
  # 使输入模式丰富多彩
  colorful: true
  # 是否开启摇动
  shake: false

## 样式定制 - 一般不需要修改,除非有很强的定制欲望…
style:
  # 头像上面的背景颜色
  # header: '#D3D1DC'
  header: '#4d4d4d'
  gif:
    # 是否启用左侧边栏动态图效果
    enable: true
    # 自定义背景图路径(默认可以不设置,提供默认背景图)
    path: /img/biubiubiu.gif
  # 右滑板块背景
  slider: 'linear-gradient(200deg,#a0cfe4,#e8c37e)'

## slider的设置
slider:
  # 是否默认展开tags板块
  showTags: true

## 智能菜单
## 如不需要,将该对应项置为false
## 比如
#smart_menu:
##  friends: false
smart_menu:
  innerArchive: '所有文章'
  friends: '友链'
  aboutme: '关于我'

## 友情链接
friends:
  #技术笔记:  #网站名称
    #网站地址
    #url: https://zhousiwei.gitee.io/ibooks/
    #网站图片(可忽略不写)
    #img: https://zhousiwei.gitee.io/ibooks/favicon.ico
    #网站简介(可忽略不写)
    #description: 记录工作和学习过程中的笔记:SLAM、矩阵运算、后端优化、传感器融合
  柯大佬:
    url: https://keyanjie.net/
  老刘:
    url: http://47.94.197.207/
  思佳:
    url: http://39.106.56.59/
  想成:
    url: http://39.107.34.96/
  越越:
    url: http://www.ci-cada.com/

## 关于我
aboutme: 主要涉及技术:<br>动态场景定位、VIO、多传感器融合<br>开源爱好者、Linux<br><br>联系QQ:694459065<br><br>希望能和大家多多学习交流<br>谢谢大家
plaintext
hexo常用配置修改
https://525511.xyz/blog/hexo%E5%B8%B8%E7%94%A8%E9%85%8D%E7%BD%AE%E4%BF%AE%E6%94%B9
Author Haochen Jiang
Published at August 25, 2019
Comment seems to stuck. Try to refresh?✨