新建文章

1
2
3
4
5
6
7
8
9
10
hexo new [layout] <title> --path <path>

# -p 参数可以指定文章的路径
hexo new post -p hello/hello-world # 注意里面的title为post

# 此时里面的title为hello-world
# hexo new post title -p dir/filename
hexo new post hello-world -p hello/hello-world

## 当然了手动将文章放到指定的文件夹中也可以

常用的文件头

1
2
3
4
5
6
7
8
9
10
11
12
13
14
---
title: 添加一篇新文章
date: 2024-12-12 15:24:11
tags: [教程]
categories: [博客]
keywords: [博客,教程]
description: hexo 添加新文章用到的几个命令
top_img: https://i.postimg.cc/ZTZP2sy2/202505201313563.png
// 这里改了代码,可以调整图片的位置,默认是center center,
// 如果只有bottom -215px, 实际渲染会将center填充到bottom前,
// 变为 background-position: center bottom -215px;
top_img_position: center bottom -215px
cover: https://i.postimg.cc/2kg1R3Ky/202505201321672.png
---

启动本地服务器

1
hexo server

上传algolia搜索关键字

1
hexo algolia

发布文章

1
2
3
hexo clean
hexo generate
hexo deploy

其他用到的数据

图床

https://postimg.cc/

封面图尺寸比例

726*466

制作时留上 40px 左右的边距,因为列表上有hover效果,所以需要留出位置