鱼塘

1
npm install hexo-filter-fcircle-anzhiyu --save

相关配置(在站点配置文件_config.yml中添加):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# fcircle
# see https://anzhiy.cn/posts/3753.html
fcircle:
enable: true #控制开关
apiurl: https://friends.anzhiy.cn/ #api地址
initnumber: 30 #【可选】页面初始化展示文章数量
stepnumber: 30 #【可选】每次加载增加的篇数
css: https://npm.elemecdn.com/hexo-filter-fcircle-anzhiyu@1.1.2/assets/css/default.css #【可选】开发者接口,自定义css链接
js: https://npm.elemecdn.com/hexo-filter-fcircle-anzhiyu@1.1.2/assets/js/fcircle.js #【可选】开发者接口,自定义js链接
fetchJs: https://npm.elemecdn.com/hexo-filter-fcircle-anzhiyu@1.1.2/assets/js/fetch.js
randomFriendsPostJS: https://npm.elemecdn.com/hexo-filter-fcircle-anzhiyu@1.1.2/assets/js/random-friends-post.js
topIcon: fas fa-arrow-right
topLink: /about/
top_background: https://img02.anzhiy.cn/adminuploads/1/2022/08/21/630249e2df20f.jpg
path: /fcircle #【可选】fcircle的路径名称。默认为 fcircle,生成的页面为 fcircle/index.html
front_matter: #【可选】fcircle页面的 front_matter 配置
title: 朋友圈
comments: false
aside: false
top_img: false

后端部署文档:后端部署文档

插件参数释义

参数 备选值/类型 释义
enable true/false 控制开关
apiurl URL api 链接,配置教程参看后端部署文档
initnumber number 【可选】填写阿拉伯数字,页面展示文章数量,默认 20
stepnumber number 【可选】填写阿拉伯数字,每次加载增加的篇数,默认 10
error_img URL 【可选】头像图片加载失败时的默认头像
css URL 【可选】开发者接口,自定义 css 链接
js URL 【可选】开发者接口,自定义 js 链接
fetchJs URL 可选】开发者接口,自定义 fetchJs 链接
randomFriendsPostJS URL 可选】开发者接口,自定义 randomFriendsPostJS 链接
path string 【可选】字符串,fcircle 的路径名称。默认为 fcircle,生成的页面为 fcircle/index.html
topIcon string 【可选】字符串,顶部按钮的图标类名
topLink URL 【可选】字符串,顶部按钮点击跳转的链接(仅支持 pjax 跳转)
front_matter object 【可选】写法见上文示例,fcircle 页面的 front_matter 配置
top_background URL 【可选】字符串,页面顶部模块背景图

建议配合a-sever使用

搜索

Algolia 搜索

记得关闭本地搜索,二者只能取其一!

1
npm install hexo-algoliasearch --save

_config.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
algolia:
appId: "Z7A3XW4R2I"
apiKey: "12db1ad54372045549ef465881c17e743"
adminApiKey: "40321c7c207e7f73b63a19aa24c4761b"
chunkSize: 5000
indexName: "my-hexo-blog"
fields:
- content:strip:truncate,0,500
- excerpt:strip
- gallery
- permalink
- photos
- slug
- tags
- title

_config.butterfly.yml

1
2
3
4
5
6
7
8
# Algolia search
algolia_search:
enable: true
hits:
per_page: 3
# Local search
local_search:
enable: false

然后来看以下具体的参数配置获取方式appId,apiKey,adminApiKey可在 API Keys 页面获取,注意保管好你的 Admin Key,不要让其他人知道,不建议直接写在配置中

使用命令

1
hexo algolia

而在这之前还需要hexo g生成文件
所以具体使用命令就是

1
hexo cl && hexo g && hexo algolia

或者在未安装 HEXO CLI 的情况下使用以下命令

1
npm run clean && npm run build && hexo algolia -n && gulp

更多