这个博客其实上周就已经建好了,只是上周有点忙,就忘了写了。
这个博客其实上周就已经建好了,只是上周有点忙,就忘了写了。
于是就趁着,这周四级考完,期末考试复习还没开始,还有时间写一份总结。还有就是为了以后移植博客方便,备份一下配置文件,防止哪天硬盘掉了,数据没了,blog就废了的尴尬눈_눈。
hexo+github的搭建
这个网上都有,感觉还是挺详细的,感觉多看几个文章就差不多了
hexo的根目录的文件配置
我这里用的是next的mist,因为用的人挺多的,美化也方便一些.
下面是代码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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
title: Frystal's blog
subtitle:
description:
author: frystal
language: zh-CN
timezone:
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yoursite.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:
# 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: true
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: true
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:
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
repo: git@github.com:frystal/frystal.github.io.git
branch: master
# Live2D //左下角的看板娘配置(文件要手动拷贝到node_modules里,且要在这手动加入模型)
## https://github.com/EYHN/hexo-helper-live2d
live2d:
enable: true
scriptFrom: local # 默认
pluginRootPath: live2dw/
pluginJsPath: lib/
pluginModelPath: assets/ # 模型文件相对与插件根目录路径
tagMode: false
debug: false
model:
# use: live2d-widget-model-koharu
# use: live2d-widget-model-hibiki
use: live2d-widget-model-z16
# use: live2d-widget-model-shizuku
scale: 1
hHeadPos: 0.5
vHeadPos: 0.618
display:
superSample: 2
width: 100
height: 175
position: left
# position: right
hOffset: 0
vOffset: 0
mobile:
show: true
scale: 0.5
react:
opacityDefault: 0.7
opacityOnHover: 0.2
# Security //文章密码(样例见test_long_blog)
##
encrypt:
enable: true
default_abstract: the content has been encrypted, enter the password to read.</br>
default_message: Please enter the password to read.
default_template:
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<div id="hbe-security">
<div class="input-container">
<input type="password" class="form-control" id="pass" placeholder=" {{message}} " />
<label for="pass"> {{message}} </label>
<div class="bottom-line"></div>
</div>
</div>
<div id="encrypt-blog" style="display:none">
{{content}}
</div>
Next的mist的主题配置的文件配置
这个我感觉算是最麻烦的了 눈_눈,前前后后改了有四五天,一直是改了这个没了那个,调整字体的颜色与大小,文章的背景的透明度。
好在,最后改完之后,虽说还是有在一些地方有一些毛病,但好在我的强迫症,已经被这个折磨一个星期后,没得差不多了,于是我也就忍下来了。等以后,在有空和有多余的肝的时候再更近一步优化§:з)))」∠)。
(比如,在安卓机子上的Firefox上下翻页时,背景图片会忽大忽小,chrome上背景图片在最底下会有留白)
下面是_custom的代码
1 | // Custom styles. |
ps:我这个虽然说是部分借鉴了https://reuixiy.github.io/technology/computer/computer-aided-art/2017/06/09/hexo-next-optimization.html 但是,我发现我写的与这个并不怎么兼容 눈_눈 ,尤其是在tag与categories的页面的透明度调节方面。
Next的其余配置
剩下的配置实在是太细了,front的那个字体我就改了不下5遍,现在是我也不知道我改了什么,还是等我什么时候整理好了,在传上来吧(咕咕咕~~)
参考文章与博客
https://reuixiy.github.io/technology/computer/computer-aided-art/2017/06/09/hexo-next-optimization.html//文章美化
https://github.com/EYHN/hexo-helper-live2d//看板娘
https://github.com/MikeCoder/hexo-blog-encrypt/blob/master/ReadMe.zh.md文章密码设定