Hexo主题Coder主题使用安装方法
Kadriye Lv3

Coder使用和配置很简单:

Coder主题地址:https://github.com/Xunzhuo/Coder/tree/master

1. 下载Coder

  • 最新版:进入 /Hexo目录/themes:
1
git clone git@github.com:Xunzhuo/hexo-theme-coder.git coder
  • 稳定版:在Released下载 ZIP 解压在 /themes 文件夹下

2.安装搜索插件

1
npm install hexo-generator-searchdb --save

3. 修改Hexo目录下的_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
title: Kadriye's travel diary
subtitle: ''
description: ''
keywords: null
author: John Doe
language: en
timezone: ''
url: http://example.com
permalink: ':year/:month/:day/:title/'
permalink_defaults: null
pretty_urls:
trailing_index: true
trailing_html: true
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: ':lang'
skip_render: null
new_post_name: ':title.md'
default_layout: post
titlecase: false
external_link:
enable: true
field: site
exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
syntax_highlighter: highlight.js
highlight:
line_number: true
auto_detect: false
tab_replace: ''
wrap: true
hljs: false
prismjs:
preprocess: true
line_number: true
tab_replace: ''
index_generator:
path: ''
per_page: 10
order_by: '-date'
default_category: uncategorized
category_map: null
tag_map: null
meta_generator: true
date_format: YYYY-MM-DD
time_format: HH:mm:ss
updated_option: mtime
per_page: 10
pagination_dir: page
include: null
exclude: null
ignore: null
theme: coder
deploy:
type: git
repository: git@github.com:G1314047/G1314047.github.io.git
branch: main

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


4. 语言配置

请在hexo文件下的”_config.yml”修改 languageen 或者 zh-Hans, 目前只支持这两种语言

5. 修改主题配置

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
# 当前版本 | Theme Version
Hexo: "2.1"

#语言 | Language
# en | zh-Hans
#请在hexo文件下的"_config.yml"修改language
language: en

# 网站标题 | Title
logo_title: Kadriye's blog

# 初始化风格 | Default Style "black/light"
style: black
#style: light

#SEO优化

## 网站描述
description: 这是我的知识库。为了避免遗忘、便于分享,我在这里收录知识。请随意浏览~

## 网站关键词:用英文逗号分割
keywords: Blog,Hexo,Theme,卢伟,luwei

# 首页URL | Your URL
link: https://hexo.1314047.xyz

#标语 | Your Slogan
words: 这是我的知识库。为了避免遗忘、便于分享,我在这里收录知识。请随意浏览~ 👋

# 你的昵称 | Your Name
author: Kadriye

# 中心图标选择男女或者自定义 | Gender
gender: /img/male.png #/img/female.png

# 站点小图标地址 | Small Icon of Your Site
favicon: /img/favicon.ico

# 菜单栏配置 | Nav Bar Settings
menu:
关于我: /about
导航站: https://pan.1314047.xyz
朋友圈: https://pyq.1314047.xyz


# 站内关键词搜索 | Local Search
search:
enable: true
path: search.xml
field: post
# onload: true

# 评论系统 | Comments
## 做了域名限制,请改成自己的 KEY
## 若关闭valine 设置enable为false∂
valine:
enable: true
appId: IEywqtcTRNXZJ6mFNCfz7HAF-gzGzoHsz
appKey: TdLtghA5yQJPV8EAgPLFosLm

# visitors count
counter:
enable: true

highlight:
enable: true

5. 404 页面配置:

在hexo跟目录的Source文件夹下创建一个404.md,并写入如下内容:

1
2
3
4
5
---
title: 404
type: "404"
layout: "404"
---

然后你就可以愉快的开始使用啦!😊

 评论
评论插件加载失败
正在加载评论插件