Next 主题设置-页面修改 & 自带插件
更改站名黑色背景
- 打开
Hexo/themes/next/source/css/_schemes/Pisces/_header.styl,找到background改为background: $blue-bright;,或者使用渐变色background: linear-gradient(-225deg, #9EFBD3 0%, #57E9F2 48%, #45D4FB 100%)。 - 打开
Hexo\themes\next\source\css\_variables\Pisces.styl,找到subtitle-color改为$subtitle-color = $whitesmoke; - 在
Hexo/themes/next/source/css/_variables/base.styl里可以查看颜色设置。
添加图片背景
在hexo目录下的
source文件夹下新建_data文件夹,不是主题next目录下的source文件夹。文件夹里新建文件styles.styl,添加如下内容:1
2
3
4
5
6
7//背景图片设置
body {
background-image: url(/images/background.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;
}background-image:url可以直接使用图片链接,也可以是图片路径(将自定义图片放入next\source\images)background-repeat:若果背景图片不能全屏,那么是否平铺显示,充满屏幕background-attachment:背景是否随着网页上下滚动而滚动,fixed 为固定background-size:图片展示大小,设置 100%,100% 的意义为:如果背景图片不能全屏,那么是否通过拉伸的方式将背景强制拉伸至全屏显示打开主题配置文件,找到
custom_file_path:,修改如下:1
2custom_file_path:
style: source/_data/styles.styl
页面透明化
为了更好欣赏背景图片,可将博客页面透明化,在source/_data/styles.styl里添加如下内容:
1 | // 文章透明度设置 |
边框圆角
- 在hexo目录下的
source文件夹下新建_data文件夹,文件夹中新建文件variables.styl,添加如下内容:1
2
3// 圆角设置
$border-radius-inner = 20px 20px 20px 20px;
$border-radius = 20px; - 打开主题配置文件,找到
custom_file_path:,修改如下:1
2custom_file_path:
variable: source/_data/variables.styl
图标颜色
- 在hexo目录下的
source文件夹下新建_data文件夹,不是主题next目录下的source文件夹。文件夹里新建文件styles.styl,添加如下内容: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
// 图标颜色大小
.fa{
font-size: 14px;
}
// 菜单栏
.fa-home{
color: #e74c3c;
font-size: 15px;
}
.fa-archive{
color: #00BFFF;
}
.fa-tags{
color: orange;
}
.fa-chalkboard{
color: #3498db;
}
.fa-link{
color: #FC427B;
}
.fa-user{
color: #9b59b6;
}
.fa-camera{
color: #1abc9c;
}
.fa-envelope{
color: #66CDAA;
}
.fa-zhihu{
color: #00BFFF;
}
.fa-weibo{
color: red;
}
.fa-github{
color: #7CFC00;
}
.fa-youtube{
color: red;
}
.fa-skype{
color: #00BFFF;
}
// 文章
.fa-calendar-check{
color: red;
}
.fa-tag{
color: orange;
}
.fa-eye{
color: #70a1ff;
}
.fa-comment{
color: #2ed573;
}
.fa-comments{
color: #2ed573;
}
.fa-file-word{
color: #273c75;
}
.fa-clock{
color: #ff5252;
}
.fa-image{
color: #FC427B;
}
.fa-sun{
color: orange;
}
.fa-bookmark{
color: #00FFFF;
}
.fa-book{
color: #1abc9c;
}
.fa-images{
color: #FF00FF;
}
.fa-windows{
color: #e74c3c;
}
.fa-chrome{
color: orange;
}
.fa-desktop{
color: #3498db;
}
.fa-tools{
color: #00FFFF;
}
.fa-python{
color: #3498db;
}
Next自带插件功能
1. Note
[class] [no-icon] [summary]
Any content (support inline tags too).
[class] : Optional parameter. Supported values: default | primary | success | info | warning | danger.
[no-icon] : Optional parameter. Disable icon in note.
[summary] : Optional parameter. Optional summary of the note.
Default Header
Welcome to Hexo!
Primary Header
Welcome to Hexo!
Info Header
Welcome to Hexo!
Success Header
Welcome to Hexo!
Warning Header
Welcome to Hexo!
Danger Header
Welcome to Hexo!
不显示符号no-icon:
点击后显示全部内容:
不显示符号no-icon、点击后显示全部内容:
1 | {% note [class] [no-icon] [summary] %} |
2. Tabs选项卡
指向tab
Tab one. Tab one 1. Tab one 2. Tab one 3.
This is Tab 1.
This is Tab 2.
This is Tab 3.
综合tab
This is Tab 1.
This is Tab 3.
This is Sub Tab 1.
Lorem ipsum dolor sit amet.
Sed egestas.
Morbi interdum mollis sapien.
This is Sub Tab 2.
This is Sub Tab 3.
This is Sub-Sub Tab 1 of Sub Tab 3.
Lorem ipsum dolor sit amet.
This is Sub-Sub Tab 2 of Sub Tab 3.
This is Sub-Sub Tab 3 of Sub Tab 3.
1 | [Tab one](#tab-one). [Tab one 1](#tab-one-1). [Tab one 2](#tab-one-2). [Tab one 3](#tab-one-3). |