之前的朋友圈配置是基于Butterfly的外挂标签,使用不方便,而且兼容性较差,所以我就采用了自定义的方式。

以往的方式 (标签外挂)

参考链接为标签外挂
效果和示例如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{% timeline title,purple %}

<!-- timeline title -->

xxxxx

<!-- endtimeline -->
<!-- timeline title -->

xxxxx

<!-- endtimeline -->

{% endtimeline %}

title

title

xxxxx

title

xxxxx

新方法(自定义)

先上效果图
1551
做法如下:

新建页面

将下面的代码在blogroot运行,新建一个页面:

1
hexo new post update

然后我们检查blogroot/source/update里面生成了一个文件index.md

新建数据文件

我们在blogroot/source/update路径下面,再建立一个文件talks.json,此后我们只需要修改talks.json里面的说说即可。

修改index.md文件

因为我比较懒,也怕路径问题出错,所以就直接把js,css文件都合并了,我们只需要把代码复制到index.md文件中。此代码附在文末。

参数说明

data.json文件中,格式如下:

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
{
"settings": {
"pagePassword": "",
"title": "我的动态",
"subtitle": "记录生活的点滴"
},
"talks": [
{
"id": 1,
"date": "2026-01-26 14:30",
"content": "这是一个示例文本,可以用来指示如何写说说,mood可以选择happy: 😊, sad: 😢, excited: 🎉, thinking: 🤔, angry: 😠, love: ❤️, secret: 🔒, sleepy: 😴, cool: 😎等。spoiler可以控制是否遮盖,密码是1",
"images": [
"https://assets.liu-cy.top/2026/01/988217b17d9a87900103d4aa8fc3a97e.webp",
"https://assets.liu-cy.top/2026/01/b404c3f563bffc70897c1daa0bfe454c.webp"
],
"video":"https://assets.liu-cy.top/videos/%E5%91%BD%E8%BF%90%E7%9F%B3%E4%B9%8B%E9%97%A82.mp4",
"bilibili": "BV1iL4y1z7kx",

"mood": "excited",
"tags": [
"日常",
"flag"
],
"private": false,
"spoiler": true,
"spoilerText": "隐藏内容"
}
]
}

其中部分参数说明如下:

  • id:可以随意设置
  • date:必须是完整的时间戳,比如”2026-01-06 14:30”不能简写为”2026-01-6 14:30”
  • videos:可放置视频链接
  • bilibili:可以用来播放B站链接,有三种方式:
    • BV号
    • 视频网址
    • B站提供的“内嵌代码”直接复制
  • mood:可以选择happy: 😊, sad: 😢, excited: 🎉, thinking: 🤔, angry: 😠, love: ❤️, secret: 🔒, sleepy: 😴, cool: 😎
  • privete:设置是否需要密码
  • password:设置密码,仅当private有效时有效
  • spoilerspoilerText:设置的文字,当鼠标悬停在上方的时候,才会显示,否则即为黑色。

附录(index.md代码下载)

https://assets.liu-cy.top/codes/index.md