本文借鉴自zhheo

1.获取,使用API Key

在爱发电上获取

购买完成后保存下来

在官方后台内使用

按照提示填入就可以了

2.修改博客数据

Butterfly主题:

进入博客目录**/[blog]/_config.butterfly.yml**

找到inject属性

添加如下代码

inject:
head:
- <link rel="stylesheet" href="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.8/tianli_gpt.css">
bottom:
- <script>let tianliGPT_postSelector = '\#post \#article-container';let tianliGPT_key = 'Your API Key';</script>
- <script src="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.8/tianli_gpt.js"></script>

如果开启了Pjax那么在第六行的- <script 与 src中间添加

data-pjax 

其他

你需要在博客后面位置引入js和css( 引入的位置应该在文章之后

<link rel="stylesheet" href="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.8/tianli_gpt.css">
<script>
let tianliGPT_postSelector = '#post #article-container';
let tianliGPT_key = 'Your api key';
</script>
<script src="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.8/tianli_gpt.js"></script>

其他Hexo主题?点击这里

3.升级及结尾

我们都可以见到在代码中有Your API Key的存在,把他替换为你的Api Key,API KEY 与网站关联,本地部署看不见

如需升级,点击Github中的Release中的版本

把代码中的@0.?改为最新的吧

其他问题访问详情。