1. 新建文章

1.1 新建文章目录

执行命令

1
hexo new "文章标题"

在source_posts目录下创建文章目录,文章目录的名称就是文章的标题,文章目录下创建index.md文件,文件内容如下:

1
2
3
4
5
6
7

---
title: 博客文章创建
date: 2023-04-03 14:04:09
tags:
---

文章配置 Page Front-matter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
title:
date:
updated:
type:
comments:
description:
keywords:
top_img:
mathjax:
katex:
aside:
aplayer:
highlight_shrink:
---

解释

title: 文章题目
date: 文章创建时间
updated: 文章更新时间
type: 文章类型
comments: 是否开启评论
description: 文章描述
keywords: 文章关键字
top_img: 文章顶部图片
mathjax: 【可选】显示mathjax(当设置mathjax的per_page: false时,才需要配置,默认 false)
katex: 【可选】显示katex(当设置katex的per_page: false时,才需要配置,默认 false)
aside: 【可选】显示侧边栏(当设置aside的per_page: false时,才需要配置,默认 false)
aplayer: 【可选】显示aplayer(当设置aplayer的per_page: false时,才需要配置,默认 false)
highlight_shrink: 【可选】代码折叠(当设置highlight_shrink的per_page: false时,才需要配置,默认 false)

1.2 新建文章内容

在文章目录下创建文章内容,文章内容的名称可以随意,但是后缀必须是.md,文章内容的内容如下:

1
文章内容必须使用markdown语法

2. 新建页面

执行命令

1
hexo new page "页面标题"

2.1 新建页面目录

在source目录下创建页面目录,页面目录的名称就是页面的标题,页面目录下创建index.md文件,文件内容如下:

1
2
3
4
5
---
title: 博客文章创建
date: 2023-04-03 14:04:09
tags:
---

Post Front-matter 页面配置

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
---
title:
date:
updated:
tags:
categories:
keywords:
description:
top_img:
comments:
cover:
toc:
toc_number:
toc_style_simple:
copyright:
copyright_author:
copyright_author_href:
copyright_url:
copyright_info:
mathjax:
katex:
aplayer:
highlight_shrink:
aside:
---

解释

title: 页面标题
date: 页面创建时间
updated: 页面更新时间
tags: 页面标签
categories: 页面分类
keywords: 页面关键字
description: 页面描述
top_img: 页面顶部图片
comments: 是否开启评论
cover: 页面封面
toc: 是否开启目录
toc_number: 目录是否显示序号
toc_style_simple: 目录是否显示为简单样式
copyright: 是否开启版权信息
copyright_author: 版权作者
copyright_author_href: 版权作者链接
copyright_url: 版权链接
copyright_info: 版权信息
mathjax: 【可选】显示mathjax(当设置mathjax的per_page: false时,才需要配置,默认 false)
katex: 【可选】显示katex(当设置katex的per_page: false时,才需要配置,默认 false)
aplayer: 【可选】显示aplayer(当设置aplayer的per_page: false时,才需要配置,默认 false)
highlight_shrink: 【可选】代码折叠(当设置highlight_shrink的per_page: false时,才需要配置,默认 false)
aside: 【可选】显示侧边栏(当设置aside的per_page: false时,才需要配置,默认 false)

2.2 新建页面内容

在页面目录下创建页面内容,页面内容的名称可以随意,但是后缀必须是.md,页面内容的内容如下:

1
页面内容必须使用markdown语法

3. 本地预览

执行命令

1
hexo server

4. 发布到github

执行命令

1
2
3
hexo clean
hexo g
hexo d

5. 本地发布

执行命令

1
2
3
hexo clean
hexo g
hexo s

6. 本地发布到github

执行命令

1
2
3
4
hexo clean
hexo g
hexo s
hexo d