老鬼的博客 来都来啦,那就随便看看吧~
Hexo主题配置
发布于: 2018-05-12 更新于: 2023-11-08 分类于: Hexo 阅读次数: 

1.路径

  • 本地路径

    E:\my-tools\hexo-blog_config.yml

路径

2.网站信息

2.1 内容

1
2
3
4
5
6
7
8
# Site
title: 老鬼
subtitle: 来都来啦,那就随便看看吧~
description: 知识分享,日常记录
keywords:
author: RenJie
language: zh-Hans
timezone:

2.2 说明

  • title

    网站标题

  • subtitle

    网站二级标题

  • description

    描述

  • keywords

    关键词

  • author

    作者

  • language

    语言,zh-Hans中文

  • timezone

    时区,默认电脑时区,Asia/Shanghai

3.网址设置

3.1 内容

1
2
3
4
5
6
7
# URL
# 如果网站是放在子目录中,将url设置成'http://yoursite.com/child',将root设置成'/child/'
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://jayden.matchcess.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

3.2 说明

  • url

    网站访问地址

  • root

    网站根目录。如果网站是放在子目录中,将root设置成’子目录名’

  • permalink

    文章链接地址格式 。即文章存放的目录

4.目录设置

4.1 内容

1
2
3
4
5
6
7
8
9
# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

4.2 说明

  • source_dir

    资源文件夹,放在里面的文件会上传到github中

  • public_dir

    公共文件夹,存放生成的静态文件,
    hexo clean g之后会将文件放在该目录下

  • tag_dir

    标签文件夹,默认是tags。实际存放在source/tags中。

  • archive_dir

    档案文件夹,默认是archives。

  • category_dir

    分类文件夹,默认是categories。实际存放在source/categories中。

  • code_dir

    代码文件夹,默认是downloads/code

  • i18n_dir

    国际化文件夹,默认跟language相同

  • skip_render

    这两个文件是百度和google的站长验证文件,不能渲染,否则会改变内容,不能验证过

5.本地搜索

5.1 内容

1
2
3
4
5
6
# local search 
search:
path: search.xml
field: post
format: html
limit: 10000

5.2 说明

配置本地的xml搜索,展现方式如下:

搜索

6.写作设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace:

默认就行

7.分页和日期格式化

7.1 内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
path: ''
per_page: 10
order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY年MM月DD号
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

7.2 说明

  • per_page

    每页大小

  • date_format

    日期格式

  • time_format

    时间格式

8.主题配置

8.1 内容

1
2
3
4
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

8.2 说明

9.github推送

9.1 内容

1
2
3
4
5
6
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repository: https://userName:password@github.com/JaydenRJ/JaydenRJ.github.io.git
branch: master

9.2 说明

  • type

    推送类型,git

  • repository

    仓库地址,是之前申请的gitpage地址,其中userName和password换成自己的

  • branch

    推送的分支,此时是master

  • 备注

    由于我没有用github推送,而是自己搭建的服务器,
    使用阿里云+nginx+svn推送的,可以不用配置

10.百度网站统计

10.1 内容

1
2
3
4
## 百度统计
baidu_tongji:
enable: true
sitecode: XXXXXXXXXXXX

10.2 说明

11.完整_config.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: 老鬼
subtitle: 来都来啦,那就随便看看吧~
description: 知识分享,日常记录
keywords:
author: RenJie
language: zh-Hans
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://jayden.matchcess.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:


# local search
search:
path: search.xml
field: post
format: html
limit: 10000

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace:

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
path: ''
per_page: 10
order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY年MM月DD号
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repository: https://userName:password@github.com/JaydenRJ/JaydenRJ.github.io.git
branch: master


## 百度统计
baidu_tongji:
enable: true
sitecode: XXXXXXXXXXXXXXXXXXXXX

12.相关参考文档

*************感谢您的阅读*************