添加一个小图标

增加了一个更新日期类别: updated

style.scss 添加一个updated,使用FontAwesome

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
.post {
padding: 25px 0 15px;
.post-title {
margin: 0;
color: #555;
text-align: left;
font: bold 25px/1.1 "ff-tisa-web-pro", Cambria, "Times New Roman", Georgia, Times, sans-serif;
a {
color: #555;
}
}
.post-meta {
padding: 0;
margin: 15px 0 0;
color: #6E7173;
float: left;
display: inline;
text-indent: .15em;
&:before {
font-family: "FontAwesome";
content: "\f073";
padding-right: 0.3em;
}
.category {
&:before {
font-family: "FontAwesome";
content: "\f07c";
padding-right: 0.3em;
}
}
.updated {
&:before {
font-family: "FontAwesome";
content: "\f044";
padding-right: 0.3em;
}
}

post.pug 使用span,添加updated信息

1
2
3
4
5
6
7
8
9
10
11
12
13
block content
.post
h1.post-title= page.title
.post-meta= page.date.format('ll')
if page.categories.length > 0
span= ' | '
span.category
for category in page.categories.toArray()
a(href=url_for(category.path))= category.name
if page.updated
span= ' | '
span.updated
= page.updated.format('ll')

如果在markdown文件中不添加updated这个值,那么hexo会获取文件的修改日期,并渲染出来。

参考:

添加Google Adsense

head.pug中添加

1
2
3
4
5
6
script(src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', async)
script.
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-7286632197002340",
enable_page_level_ads: true
});

添加侧边栏

添加一个微信公众号的侧边栏展示

主题layout/_widget中添加qr_code.pug

1
2
3
4
.widget
.widget-title
i(class='fa fa-weixin')= ' ' + __('微信公众号')
img(src='http://rustblogres.rustfisher.com/qrcode_for_rf_dev_gzh_258.jpg')

_config.yml中添加 qr_code

1
2
3
widgets: 
# 前面的组建
- qr_code

更改归档界面的链接个数

在工程的配置文件_config.yml里修改

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Pagination
## Set per_page to 0 to disable pagination
pagination_dir: page
index_generator:
per_page: 15
order_by: -date

category_generator:
per_page: 15

tag_generator:
per_page: 10

archive_generator:
per_page: 30
yearly: true
monthly: true
daily: false