惟愿言行合一,砥砺前行

0%

hexo依赖

不小心把本地的博客文件全部删掉了,非常不幸的是,gitee上themes文件夹中的next主题没有提交上去,导致主题全部要重新配置,累了毁灭吧。
(ps: 回退了一个hexo版本,不那么好看并且有非常非常多的bug!!!!!!!!!!!!!啊之后再改吧毁灭吧!可以看github版本,那个看起来好歹没这么多bug)

文章顺序

1
2
npm uninstall hexo-generator-index --save
npm install hexo-generator-index-pin-top --save

打开 /themes/next/layout/_macro/ 目录下的 post.swig 文件,在 <div class="post-meta"> 的第一个 <span> 标签下,插入如下代码:

1
2
3
4
5
{% if post.top == 1 %}
<i class="fa fa-thumb-tack"></i>
<font color=2E8B57>TOP</font>
<span class="post-meta-divider">|</span>
{% endif %}

加密

1
npm install hexo-blog-encrypt --save

主题设置

Gemini暗夜主题。

1
2
3
4
5
6
7
8
9
10
11
custom_file_path:
#head: source/_data/head.swig
#header: source/_data/header.swig
sidebar: source/_data/sidebar.swig
#postMeta: source/_data/post-meta.swig
#postBodyEnd: source/_data/post-body-end.swig
#footer: source/_data/footer.swig
bodyEnd: source/_data/body-end.swig
#variable: source/_data/variables.styl
#mixin: source/_data/mixins.styl
style: source/_data/styles.styl

bodyEnd:

1
2
{# 代码压缩 #}
<script type="text/javascript" src="/js/fold_action.js"></script>

styles.styl:

鼠标指针自己画两个就好了。老抽象画大师了。我的头像也是自己画的了,因为之前那个头像放在主题文件夹里,删掉了,刚好最近在画画,随便换了一个,麻了。。。。。。

png转ico的网站:PNG转ICO - 在线转换图标文件 (aconvert.com)

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
//鼠标指针设置
body {
cursor: url("/images/cursor.ico"),auto!important;
background-color:#282828;
}
//鼠标指针设置(改变)
a,span,btn,.copy-btn,.v[data-class=v] .vbtn,[data-v-0a6ec0b4],.spoiler-title,.post-meta time,.reward-container button,.sidebar-nav .sidebar-nav-active,.sidebar-nav li:hover,.spoiler .spoiler-title {
cursor: url("/images/cursor-click.ico"),pointer!important;
}
.header-inner,
.sidebar-inner,
.main-inner > .pagination,
.main-inner > .post-block,
.main-inner > .post-block:not(:first-child):not(.sub-menu)
{
border-radius: 20px 20px 20px 20px;
box-shadow: 8px 7px 2px 0 rgba(0,0,0,0.12), 7px 4px 1px -2px rgba(0,0,0,0.06), 0 1px 5px 0 rgba(0,0,0,0.12);
}

//文章内链接文本样式
.post-body li a,.post-body p a{
color: #E68F89;
border-bottom: none;
border-bottom: 1px solid #555;
&:hover {
color: #E68F89;
border-bottom: none;
border-bottom: 1px solid #fc6423;
}
}
//单行代码样式
code {
background: #252525;
border-radius: 4px;
color: #F2C7C4;
font-size: 15px
}
//版权声明样式
.post-copyright ul{
background: #1D1F21;
border-left:3px solid #E68F89;
}
//侧栏颜色
.sidebar-toc-active .sidebar-nav-toc,
.sidebar-overview-active .sidebar-nav-overview,
.post-toc .nav .active > a{
color: #E68F89;
border-bottom-color:#E68F89;
}
.sidebar-nav li:hover ,
.sidebar-toc-active .sidebar-nav-toc:hover
.sidebar-overview-active .sidebar-nav-overview:hover{
color: #FF7B71;
}
.post-toc-wrap .post-toc .nav .nav-item .nav-link:hover
.post-meta-item>a:hover{
color: #F2C7C4;
border-bottom-color:#F2C7C4;
}

// 代码折叠功能添加
.hider_title{
cursor: pointer;
color: #ef4a05;
}
.close:before{
content: "▼";
}
.open:before{
content: "▲";
}

.config.yml:

1
2
3
4
5
6
7
8
9
10
11
12
codeblock:
# Code Highlight theme
# Available values: normal | night | night eighties | night blue | night bright | solarized | solarized dark | galactic
# See: https://github.com/chriskempson/tomorrow-theme
highlight_theme: night
# Add copy button on codeblock
copy_button:
enable: true
# Show text copy result.
show_result: false
# Available values: default | flat | mac
style: mac