hexo-gpt-tag
v1.3.3
Published
Automatically tag your Hexo posts with GPT|使用GPT自动为Hexo文章添加标签
Downloads
31
Maintainers
Readme
hexo-gpt-tag
Automatically generate article tags with GPT 中文文档
Installation
npm install hexo-gpt-tag
Usage
- Add the following to your Hexo site's
_config.yml
file:
gpt_tag:
enable: true
apiKey: <YOUR_OPENAI_API_KEY>
override: true # whether to override existing tags
max_tags: 5 # Generate at most how many tags
max_tokens: 2048 # (Optional) The maximum number of blog tokens used to send to gpt
model: gpt-4o-mini, # The gpt model to use
base_url: "https://api.openai.com/v1" # (Optional) OpenAI API base URL
prompt: "<YOUR_OWN_PROMPT>" # (Optional) Prompt to generate tags for post.
You can get your API key from here. It may require a paid plan to use the API.
- Run the following command when ready to generate your site:
hexo clean && hexo generate
Make sure to run BOTH hexo clean
and hexo generate
.
- Tags will not be regenerated if blog post is not changed. Remove
./.cache
folder and generate your site if you want to regenerate tags even if blog post is not changed.