Hexo博客搭建食用指北

19 年参考这个搭了自己的 blog,现在当年的版本太低,于是乎自己研究了下,重构了一遍。

域名

域名的申请

提示:freenom 近期因技术原因暂时关闭了域名注册服务。以下内容可能短时间内不可用。

土豪请略过,我这里谈的是免费

首先打开freenom

网站打开慢可以挂个代理。事实上不管挂不挂好像都挺慢的,尤其是选好域名进入结算的时候

freenom

搜索你想要的域名

搜索域名

选择你想要的

选择域名

结算

结算

进入结算页面

结算页面

先点1,把3 Months @FREE改成12 Months @FREE

不然你的域名有效期只有3个月

然后点你要保留的域名中的2(Use DNS)

点3(Use your own DNS)

选择你的DNS服务商:

建议:


Hexo blog

注:这里只介绍 next 主题。

本文的配置基于 Hexo 7.0 和 Next 8.17.1 实现。

Hexo 配置

这部分的配置需要修改根目录下的 _config.yml

好像只有一点东西可以设啊

标题

1
title: yltx's blog

作者

1
author: 引领天下

语言

应该在第11行的位置

1
language: zh-CN

这样页面语言就是中文了。

主题

1
theme: next

Next 配置

开始配置前,我们需要先安装 Next 主题。

建议通过 npm 方式安装,这样后续升级比较方便。

1
npm i hexo-theme-next@latest

安装完成后,为了避免以后更新主题时配置文件被覆盖,我们需要拷贝一份到根目录下配置:

1
cp node_modules/hexo-theme-next/_config.yml _config.next.yml

后续的配置都通过修改 _config.next.yml 实现。

选择 4 种主题中的一种

1
2
3
4
5
# Schemes
scheme: Muse
#scheme: Mist
#scheme: Pisces
#scheme: Gemini

把想要的那种前面的#去掉,不想要的加上即可。

改变网站图标

注意这里写的路径是相对根目录下的 source 的。

为了方便后续更新,我直接在 source 下新建了一个 favicons 文件夹,用来存相关图标。

于是我的配置是这样的:

1
2
3
4
5
6
favicon:
small: /favicons/favicon-16x16-me.png
medium: /favicons/favicon-32x32-me.png
apple_touch_icon: /favicons/apple-touch-icon-me.png
safari_pinned_tab: /favicons/mylogo.svg
#android_manifest: /manifest.json

注:大小要符合。比如 16x16 就是长宽都为 16px 的图片。

页脚设置

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
footer:
# Specify the year when the site was setup. If not defined, current year will be used.
since: 2015 # 建站时间

# Icon between year and copyright info.
icon:
# Icon name in Font Awesome. See: https://fontawesome.com/icons
name: fa fa-heart # 填充在时间和站长之间的符号
# If you want to animate the icon, set it to true.
animated: true # 设置为 true 使得图标具有动画效果
# Change the color of icon, using Hex Code.
color: "#808080"

# If not defined, `author` from Hexo `_config.yml` will be used.
copyright:

# Powered by Hexo & NexT
powered: true

# Beian ICP and gongan information for Chinese users. See: https://beian.miit.gov.cn, http://www.beian.gov.cn
beian: # 备案相关设置。我没备案,所以我没设置。
enable: false
icp:
# The digit in the num of gongan beian.
gongan_id:
# The full num of gongan beian.
gongan_num:
# The icon for gongan beian. See: http://www.beian.gov.cn/portal/download
gongan_icon_url:

顶部菜单栏

1
2
3
4
5
6
7
8
9
10
11
menu:
home: / || fa fa-home
about: /about/ || fa fa-user
tags: /tags/ || fa fa-tags
#categories: /categories/ || fa fa-th
archives: /archives/ || fa fa-archive
Games: https://game.yltx.cf || fa fa-gamepad
Visit-map: /Visit-map/ || fa fa-map-signs
#schedule: /schedule/ || fa fa-calendar
#sitemap: /sitemap.xml || fa fa-sitemap
#commonweal: /404/ || fa fa-heartbeat

将需要的项目取消注释即可在侧边栏显示。

如果需要使用“关于”页面,输入命令 hexo new page "about"

然后在 \source\about\index.md 中就可以编辑“关于”页面了。

可以修改 \source\about\index.md 中的 title 项来显示“关于”而非“about”

如果需要使用“标签”功能,需要在博文中添加选项 tags

如果有多个标签,每行一个,以 - 开头:

1
2
3
4
tags:
- 标签1
- 标签2
- 标签3

如果需要使用“标签”页面,输入命令 hexo new page "tags"

然后向 source\tags\index.md 中添加一行:

1
type: "tags"

tip:所有这里使用的图标都来自图标库v5。想要什么图标可以自己搜索。

站内搜索

输入命令 npm install hexo-generator-searchdb --save 安装所需的库。

在根目录下的 _config.yml 的结尾加入:

1
2
3
4
5
search:
path: search.xml
field: post
format: html
limit: 10000

然后在 \themes\next\_config.yml 中,打开 local_search

1
2
local_search:
enable: true

社♂交

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
social:
GitHub: https://github.com/yltx || fab fa-github
E-Mail: mailto:[email protected] || fa fa-envelope
#Weibo: https://weibo.com/yourname || fab fa-weibo
Google: https://plus.google.com/mvp.bxbl || fab fa-google
Twitter: https://twitter.com/SbF5_HSO3F || fab fa-twitter
#FB Page: https://www.facebook.com/yourname || fab fa-facebook
#StackOverflow: https://stackoverflow.com/yourname || fab fa-stack-overflow
#YouTube: https://youtube.com/yourname || fab fa-youtube
#Instagram: https://instagram.com/yourname || fab fa-instagram
#Skype: skype:yourname?call|chat || fab fa-skype
洛谷: https://www.luogu.org/space/show?uid=39863 || fa fa-laptop-code
Codeforces: https://www.codeforces.com/profile/yltx || fa fa-laptop-code
bilibili: https://space.bilibili.com/394872265 || fa fa-tv
social_icons:
enable: true
icons_only: false
transition: false

social 下每行一个,格式为:名称: 地址 || 图标

其中,“图标”与上文标题栏图标来源相同。

1
2
social_icons:
enable: false

这样设置可以只显示名称不显示图标。

友情链接(或其它链接)

1
2
3
4
5
6
7
8
9
# Blog rolls
links_settings:
icon: fa fa-globe
title: 友链
# Available values: block | inline
layout: inline

links:
引领天下: https://yltx.cf

icon:显示在标题前的图标。

title:标题。

layoutblock 一行一个,inline 一行多个。

links:要显示的链接以及名称。

格式为 名称: 链接

头像

1
2
3
4
5
6
7
8
# Sidebar Avatar
avatar:
# Replace the default image and set the url here.
url: /favicons/39863.png
# If true, the avatar will be displayed in circle.
rounded: false
# If true, the avatar will be rotated with the cursor.
rotated: false

url:头像地址,留空则不显示头像。

rounded:圆/方头像。

rotated:随光标旋转。

回到顶部按钮+阅读百分比

1
2
3
4
5
6
back2top:
enable: true # 启用回到顶部按钮
# Back to top in sidebar.
sidebar: true # 将回到顶部按钮置于侧边栏中
# Scroll percent label in b2t button.
scrollpercent: true # 显示阅读百分比

阅读进度

1
2
3
4
5
6
7
8
9
10
# Reading progress bar
reading_progress:
enable: true # 显示阅读进度(横条)
# Available values: left | right
start_at: left # 从左侧开始
# Available values: top | bottom
position: top # 位于顶部
reversed: false
color: "#37c6c0" # 颜色
height: 3px # 横条宽度

博客首页不显示全文

在博文里可以用 <!-- more --> 来标识在首页显示到哪为止。

可以在文章中使用 description 来指定显示在首页的内容。

例如:

1
2
3
4
5
6
7
---
title: Hexo博客搭建食用指北
tags: 技术
top: 4
date: 2019-01-18 19:10:39
description: 记录了自己搭建blog的过程。
---

代码块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
codeblock:
# Code Highlight theme
# All available themes: https://theme-next.js.org/highlight/
theme:
light: default # 代码块风格。详细的可以在上面的网址中查看。
dark: stackoverflow-dark
prism:
light: prism
dark: prism-dark
# Add copy button on codeblock
copy_button:
enable: true # 启用复制按钮
# Available values: default | flat | mac
style: default # 复制按钮风格

$\LaTeX$

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
math:
# Default (false) will load mathjax / katex script on demand.
# That is it only render those page which has `mathjax: true` in front-matter.
# If you set it to true, it will load mathjax / katex script EVERY PAGE.
every_page: true # 在所有页面上都渲染 LaTeX 公式

mathjax:
enable: true # 启用 mathjax
# Available values: none | ams | all
tags: all

katex:
enable: true # 启用 katex
# See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
copy_tex: true

评论功能

gitalk:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Gitalk
# For more information: https://gitalk.github.io
gitalk:
enable: false # 设置为 true 以启用gitalk
github_id: yltx
repo: yltx.github.io
client_id: ********
client_secret: **************
admin_user: yltx
distraction_free_mode: true # Facebook-like distraction free mode
# When the official proxy is not available, you can change it to your own proxy address
proxy: https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token # This is official proxy address
# Gitalk's display language depends on user's browser or system environment
# If you want everyone visiting your site to see a uniform language, you can set a force language value
# Available values: en | es-ES | fr | ru | zh-CN | zh-TW
language:

这里需要在 GitHub 新建一个 OAuth App,“Homepage URL”和“Authorization callback URL”填你的域名(如果没有申请域名的话就填 yourname.github.io):

需要注意的是,地址要严格和博客访问地址一样,httphttps不能混,有无 www 也不能混。

然后将 Client IDClient Secret 填入上方的 * 中。

Waline

我使用的是 Waline 评论系统。

具体做法是,在 _config.next.yml 的末尾添加以下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Waline
# For more information: https://waline.js.org, https://github.com/walinejs/waline
waline:
enable: true #是否开启
serverURL: waline-gamma-swart.vercel.app # Waline 服务端地址,我们这里就是上面部署的 Vercel 地址
placeholder: 快来填满我! # 评论框的默认文字
avatar: mm # 头像风格
meta: [nick, mail, link] # 自定义评论框上面的三个输入框的内容
pageSize: 10 # 评论数量多少时显示分页
lang: zh-cn # 语言, 可选值: en, zh-cn
# Warning: 不要同时启用 `waline.visitor` 以及 `leancloud_visitors`.
visitor: true # 文章阅读统计
comment_count: true # 如果为 false , 评论数量只会在当前评论页面显示, 主页则不显示
requiredFields: [nick,mail] # 设置用户评论时必填的信息,[nick,mail]: [nick] | [nick, mail]
libUrl: # Set custom library cdn url

详细的配置方式可以参考官方文档。相当详细。

访客记录

1
2
3
4
5
6
7
8
9
10
# Show Views / Visitors of the website / page with busuanzi.
# For more information: http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
enable: true # 设置为 true 以启用
total_visitors: true # 统计总访问人数
total_visitors_icon: fa fa-user
total_views: true # 统计总访问次数
total_views_icon: fa fa-eye
post_views: true # 统计每篇文章的访问次数
post_views_icon: far fa-eye

书签

书签的功能是关闭页面/手动点击书签按钮时,保存这篇博客看到的位置,下次点进这篇博客时继续从这个位置开始。

安装插件:

1
git clone https://github.com/theme-next/theme-next-bookmark.git source/lib/bookmark

更改 _config.next.yml

1
2
3
4
5
6
7
8
# Bookmark Support
bookmark:
enable: true # 设置为 true 以启用书签功能
# Customize the color of the bookmark.
color: "#222"
# If auto, save the reading progress when closing the page or clicking the bookmark-icon.
# If manual, only save it by clicking the bookmark-icon.
save: auto # 自动或者手动保存书签

convas-nest 背景

回到根目录,在 source/_data 下创建文件 footer.njk,填入以下内容:

1
2
3
{% raw %}
<script color="252,255,0" opacity="0.5" zIndex="-1" count="135" src="https://cdn.jsdelivr.net/npm/canvas-nest.js@1/dist/canvas-nest.js"></script>
{% endraw %}

然后修改 _config.next.yml 中的 custom_file_path

1
footer: source/_data/footer.njk

RGB选项可以自己配置线条颜色。

follow me

1
2
3
4
5
6
7
# Subscribe through Telegram Channel, Twitter, etc.
# Usage: `Key: permalink || icon` (Font Awesome)
follow_me:
Twitter: https://twitter.com/SbF5_HSO3F || fab fa-twitter
Telegram: https://t.me/yltx || fab fa-telegram
WeChat: /favicons/wechat_channel.png || fab fa-weixin
#RSS: /atom.xml || fa fa-rss

想必已经足够清楚了。

侧边栏

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
sidebar:
# Sidebar Position.
#position: left
position: right # 选择侧边栏位置

# Manual define the sidebar width. If commented, will be default for:
# Muse | Mist: 320
# Pisces | Gemini: 240
#width: 300

# Sidebar Display (only for Muse | Mist), available values:
# - post expand on posts automatically. Default.
# - always expand for all pages automatically.
# - hide expand only when click on the sidebar toggle icon.
# - remove totally remove sidebar including sidebar toggle.
display: post

# Sidebar padding in pixels.
padding: 18
# Sidebar offset from top menubar in pixels (only for Pisces | Gemini).
offset: 12

标签图标

1
2
# Use icon instead of the symbol # to indicate the tag at the bottom of the post
tag_icon: true

Follow me on Github

1
2
3
4
5
# `Follow me on GitHub` banner in the top-right corner.
github_banner:
enable: true
permalink: https://github.com/yltx
title: Follow me on GitHub

PDF

这是能让你在博客中直接显示 PDF 文件的插件。

首先回到根目录,下载插件:

1
git clone https://github.com/next-theme/theme-next-pdf source/lib/pdf

然后修改 _config.next.yml

1
2
3
4
5
6
7
8
# PDF tag
# NexT will try to load pdf files natively, if failed, pdf.js will be used.
# So, you have to install the dependency of pdf.js if you want to use pdf tag and make it available to all browsers.
# See: https://github.com/next-theme/theme-next-pdf
pdf:
enable: true
# Default height
height: 500px

pjax

1
2
3
# Easily enable fast Ajax navigation on your website.
# For more information: https://github.com/next-theme/pjax
pjax: true

FancyBox

1
2
3
# FancyBox is a tool that offers a nice and elegant way to add zooming functionality for images.
# For more information: https://fancyapps.com/fancybox/
fancybox: true

顶部进度条

1
2
3
4
5
6
7
8
9
10
11
# Progress bar in the top during page loading.
# For more information: https://github.com/CodeByZach/pace
pace:
enable: true # 设置为 true 以启用
# All available colors:
# black | blue | green | orange | pink | purple | red | silver | white | yellow
color: blue # 选择进度条颜色
# All available themes:
# big-counter | bounce | barber-shop | center-atom | center-circle | center-radar | center-simple
# corner-indicator | fill-left | flat-top | flash | loading-bar | mac-osx | material | minimal
theme: minimal # 选择进度条形式

其他配置

博客背景

\source\_data\styles.styl 中输入:

1
2
3
4
body {
background-image:url(URL);
background-size: cover;
}

其中 URL 是你想作为背景的图片的地址。可以是网址,可以是本地地址。

background-size: cover; 表示宽度缩放至页面大小。

1
2
3
4
5
6
body {
background-image:url(/images/background.jpg);
background-repeat: no-repeat;
background-attachment:fixed;
background-size: cover;
}

如果修改成这样的话背景图片就不会滚动。

如果不想让博客内容挡住背景,可以设置博客内容的透明度,在 \themes\next\source\css\_custom\custom.styl 中加入下面的代码即可:

1
2
3
.main-inner {
opacity: 0.8;
}

README.md

如果想在 https://github.com/yourname/yourname.github.io 让别人看到你的博客的简介,就需要写一个 README.md 放在根目录下的 source 文件夹内。

然而,只是这样的话, README.md 会被渲染成 html,所以需要更改根目录下 _config.yml 的设置:

1
skip_render: README.md

自定义404页面

首先写一个 \source\404.html

至于怎么写html……关于这个问题,我想到了一种美妙的解法,可惜这里地方太小写不下作者最近打算抽空写个专门介绍404.html的博文呢……

事实上可以新建一篇博客,用 Markdown 写一个 404 页面,然后 hexo g\public 里找到博客的页面,把相关部分直接复制过来。

可以参考一下我的:

1
2
3
4
5
6
7
8
9
10
11
12
<body background="https://raw.githubusercontent.com/yltx/yltx.github.io/master/images/background.jpg" font-family: "楷体">
<style>body {font-family: 楷体;}</style>
<div style="text-align: center;">
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<p style="font-size: 50px;color: gold"><strong>您可能访问了错误的网址</strong><br/><strong>404,that page cannot be found.</strong><br/><img src="https://i.loli.net/2019/03/03/5c7b8d8caeefe.gif"></p>
<p style="font-size: 30px;color:silver"><a href="https://www.yltx.cf"><button type="button" class="btn btn-info">回到博客主页</button></a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="javascript:history.go(-1);"><button type="button" class="btn btn-info">返回上一页</button></a></p>
<!-- <p <a href="https://www.yltx.cf"><strong>回到博客主页</strong></a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="javascript:history.go(-1);"><strong>返回上一页</strong></a></p> -->
<!-- <p style="text-align: center;"></p> -->
</div>
</body>

发布效果:https://yltx.cf/404

然后,如果直接这样发布,html 会被渲染,就跟一个自定义页面(hexo new page)一样了。

所以要修改根目录下的 _config.yml,在 skip_render: 后添加 404.html,如果有多项用 - 隔开:

1
2
3
skip_render:
- README.md
- 404.html

发布完成后,访问一个错误的网址,比如 你的域名/qaq 就可以查看效果了。

折叠效果

原文

效果见下面附录部分

博文自定义排序

打开 \node_modules\hexo-generator-index\lib\generator.js

用以下内容覆盖原内容↓

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
var pagination = require('hexo-pagination');

module.exports = function(locals) {
var config = this.config;
var posts = locals.posts.sort(config.index_generator.order_by);

posts.data = posts.data.sort(function(a, b) {
if(a.top && b.top) {
if(a.top == b.top) return b.date - a.date;
else return b.top - a.top;
}
else if(a.top && !b.top) {
return -1;
}
else if(!a.top && b.top) {
return 1;
}
else return b.date - a.date;
});

var paginationDir = config.pagination_dir || 'page';

return pagination('', posts, {
perPage: config.index_generator.per_page,
layout: ['index', 'archive'],
format: paginationDir + '/%d/',
data: {
__index: true
}
});
};

之后在博文设置中加入 top: x 即可,会以 top 为第一关键字,时间为第二关键字排序。若 top 为空则视作 -INF 。


原文


连接github

配置github仓库

首先你要有一个github账号……

然后登录

新建一个repo:

输入名字,保存:

注意:yourname要换成你的githubID。

比方说我的就是yltx.github.io

然后点2就可以了。

上传

在本地输入:

1
ssh-keygen

让你输东西就空着,按回车就行(应该要三次吧)

输入命令:

1
cat ~/.ssh/id_rsa.pub

复制窗口中出现的一堆乱码一样的东西

然后回到github,点头像打开Settings

点击左侧的SSH and GPG keys

我的已经有一个了不用管

New SSH Keys,新建一个,标题随便,把刚才复制的一堆东西粘贴进去,然后点”Add SSH key”就行了。

然后在本地输入命令

1
ssh -T [email protected]

若出现Hi yourname! You've successfully authenticated, but GitHub does not provide shell access就表示SSH配置成功了

输入命令

1
npm install hexo-deployer-git --save

就可以安装deployer。

打开根目录(在本地创建的那个文件夹)下的_config.yml,在最后输入:

1
2
3
4
deploy:
type: git
repository: https://github.com/yourname.github.io.git
branch: master

当然yourname要改成你的Github ID了。

输入命令:

1
2
3
hexo cl
hexo g
hexo d

这一步可能要输入密码(出现一个弹框)

以后可以用简化的命令:

1
2
hexo cl
hexo g -d

等几分钟,打开yourname.github.io应该就可以看到你的博客了。

那么恭喜你,你上传好了。

连接域名和github

先在hexo根目录的source子目录下新建文件CNAME重要!没有.txt之类的后缀名!

然后打开,输入你的域名(注意,如果使用gitalk,在此处输入的域名必须与App中的一样)

例:

CNAME:

1
yltx.cf

App:

1
https://yltx.cf

千万不能随便加www!要加要一起加!

dnspod

在本地打开cmd(命令提示符),输入命令:

1
ping yourname.github.io

yourname要换成你自己的githubID。

会出来一个IP地址:

我红笔圈出来的部分

然后打开dnspod中你之前添加的域名

把这个IP填到之前dnspod我们瞎填111.111.111.111的地方,保存


Cloudflare

打开Cloudflare官网

有的登录,没的注册

登录好了之后:

点右上角的Add Site,输入你的域名

添加好之后

接下来肯定是点Next啦

咳咳咳选哪个套餐就看你有多少钱啦

我选的是FREE

点Confirm Plan

再点一次Confirm

不要问我为什么换了域名,因为Cloudflare要求要存在的域名,而我并没有真的申请kkksc03.ml

然后点continue应该就可以了


在本地输入命令:

1
hexo d

过几分钟域名应该就可以用了。

开启https

如果不开启的话,访问 https://你的域名 就会显示警告,访问 http://你的域名 就会显示不安全。

当然如果因为某种原因访问 https://你的域名 已经不会显示警告而且浏览器左上角有绿锁了,就不需要再进行额外的设置了。

其实很简单,浏览器打开https://github.com/yourname/yourname.github.io/settings,找到这里:

(我已经开过了)

勾选Enforce HTTPS即可。

停用域名

单纯停用只需删去 CNAME 文件即可,然后记得更改相关设置(在各种地方引用的博客链接、OAuth App 地址……)。

Q&A

Q1

Q:“Enforce HTTPS”前面是灰色的,无法打勾

A:

  1. 删掉“Save”前面的域名,点击“Save”。

  2. 重新输入域名,点击“Save”。

  3. 重新发布博客(hexo d)。

  4. 等待几分钟~几小时,再访问你的博客应该就OK了。

Q2

Q:gitalk用不了

A:检查App和CNAME域名是否相同(上文说过)

特殊的:如果开启了https则URL一定要填https。

Q3

Q:停用域名不成功,即:在电脑上访问博客还是自动跳转到原有域名

A:

  1. 按F12

  2. 点Network

  3. 勾选Disable Cache

  4. 按Ctrl+F5强制刷新

  5. 取消勾选

方法来源

Q4

Q:代码块出锅,没有高亮,还没办法复制

A:检查根目录下的_config.yml,将highlight一段改成下面即可:

点击展开/收起

1
2
3
4
5
highlight:
enable: true
line_number: true
auto_detect: true
tab_replace:

附录

常用命令

1
hexo cl

删除编译文件夹public,方便重新编译

1
hexo g

编译。

1
hexo d

上传。

1
hexo g -d

编译后上传。

1
hexo new page "xxx"

新建一个以“xxx”为名的页面,md文件直接存放在\source文件夹下。

1
hexo n "xxx"

新建一篇以“xxx”为名的博文,md文件存放在\source\_posts文件夹下。