All guides have been tested on Hexo.NexT only.
This post is intended to list most of the personalization methods included in my blog, key references I have used are written below. Hope this will help you set up your own blog.
Reference links
First, You should check
_config.yml
in your blog root for details.Next, please note that the Hexo theme
NexT
provides various kinds of Third Party Services, check_config.yml
in/themes/next/
for further information.Afterwards, These guides may help.
Guidance on
Hexo
: Hexo documentation.
Guidance onNexT
: Getting-started. ( Written in Chinese)
- Finally, Plugins are cool bits of programming scripts that add additional functionality to your blog. Here are some plugins for Hexo.
Decorate the article frame using a shadow effect
Open themes/next/source/css/_custom/custom.styl
, add codes below:
1 | .post { |
Three additional style in article writing
Highlight colors
Open custom.styl
in themes/next/source/css/_custom
, add codes below: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// yellow
span#inline-yellow {
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:0;
background-color: #f0ad4e;
}
// green
span#inline-green {
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:0;
background-color: #5cb85c;
}
// blue
span#inline-blue {
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:0;
background-color: #2780e3;
}
// purple
span#inline-purple {
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:0;
background-color: #9954bb;
}
Insert codes as needed while writing:1
2
3
4<span id="inline-blue"> Example blue </span>
<span id="inline-purple"> Example purple </span>
<span id="inline-yellow"> Example yellow </span>
<span id="inline-green"> Example green </span>
The results are as follows:
Example blue
Example purple
Example yellow
Example green
Download link style
Open themes/next/source/css/_custom/custom.styl
, copy codes below:1
2
3
4
5
6
7
8
9
10
11
12
13
14a#download {
display: inline-block;
padding: 0 10px;
color: #000;
background: transparent;
border: 2px solid #000;
border-radius: 2px;
transition: all .5s ease;
font-weight: bold;
&:hover {
background: #000;
color: #fff;
}
}
Insert codes as needed while writing:1
<a id="download" href="https://git-scm.com/download/win"><i class="fa fa-download"></i><span> Download Now</span> </a>
The result is as follows:
Download Now
Insert Font Awesome Icons
1 | <i class="fa fa-pencil"></i> Markdown + Font Awesome |
The result is as follows:
Markdown + Font Awesome
Make everything transparent
Only for Pisces & Gemini.
Content plate
Open themes\next\source\css\_schemes\Pisces\_layout.styl
, find .content-wrap
label, change background: white
to1
background: rgba(255,255,255,0.7); //transparency is 70%
Menu bar
Open themes\next\source\css\_schemes\Pisces\_layout.styl
, find .header-inner
label, change background: white
to1
background: rgba(255,255,255,0.7); //transparency is 70%
Side bar
Open themes\next\source\css\_schemes\Pisces\_sidebar.styl
, find .sidebar-inner
label, change background: white
to1
background: rgba(255,255,255,0.7); //transparency is 70%
Then open themes\next\source\css\_schemes\Pisces\_layout.styl
, find .sidebar
label, change background: $body-bg-color
to1
background: rgba(255,255,255,0.7); //transparency is 70%
Adding background image
Open themes/next/source/css/_custom/custom.styl
, add codes below:1
2
3
4
5
6
7body{
background:url(/images/bg.jpg); //Enter your background image address.
background-size:cover;
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
}
Add your waifu (live2d support)
Install module
1 | npm install --save hexo-helper-live2d |
Support pages:
Install model
Use exist models
Search for the model of your waifu.
The storage of live2d models: live2d-widget-models
Use custom model
If your waifu does not exist in the storage above, you need to prepare your own Live2D® model.
Browse hexo-helper-live2d
official pages for support, Check this out.
Config
Change live2d-helper
settings as you need in _config.yml
, Take mine for example.
1 | live2d: |
Title background colour
Only for Pisces & Gemini.
Way 1
In this way, you need to modify the source code, remember to backup.
Open source/css/_schemes/Pisces/_brand.styl
1
2
3
4
5
6
7
8
9
10
11.site-meta {
padding: 20px 0;
color: white;
background: $black-deep; //Change colour as you want.
+tablet() {
box-shadow: 0 0 16px rgba(0,0,0,0.5);
}
+mobile() {
box-shadow: 0 0 16px rgba(0,0,0,0.5);
}
}
Way 2
Instead of modifying the source code, you can just type codes to custom styles files
.
Open next/source/css/_custom/custom.styl
, add codes:1
2
3.site-meta {
background: $blue-dodger; //Change colour as you want.
}
Change split line between two articles
Open themes/next/source/css/_common/components/post/post-eof.styl
, change the parameter.
1 | .posts-expand { |
New hyperlink style
Open themes/next/source/css/_custom/custom.styl
, add codes below:1
2
3
4
5
6
7
8
9
10
11// Hyperlink style
.post-body p a{
color: #0593d3;
border-bottom: none;
border-bottom: 1px solid #0593d3;
&:hover {
color: #fc6423;
border-bottom: none;
border-bottom: 1px solid #fc6423;
}
}
Add ending mark at every article
Create a new file passage-end-tag.swig
in /themes/next/layout/_macro
1
2
3
4
5<div>
{% if not is_index %}
<div style="text-align:center;color: #F08080;font-size:14px;">---<i class="fa fa-bell"></i> The following is a wasteland without any knowledge.---</div>
{% endif %}
</div>
Open themes/next/layout/_macro/post.swig
, add codes below:1
2
3
4
5<div>
{% if not is_index %}
{% include 'passage-end-tag.swig' %}
{% endif %}
</div>
Open themes/next/_config.yml
, add codes below:1
2
3# Add ending mark
passage_end_tag:
enabled: true
Compressing static resources
Open git bash, cd to your blog root directory, install gulp1
$ npm install gulp -g
1 | npm install gulp-minify-css --save |
Create a new file gulpfile.js
in root
1 | var gulp = require('gulp'); |
Run gulp
after you generate
:1
2$ hexo g
$ gulp
To be continued..