npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

hexo-butterfly-new-post-tag

v1.1.3

Published

Hexo Butterfly 主题最新文章标签插件

Readme

hexo-butterfly-new-post-tag

Hexo Butterfly 主题的最新文章标记插件,在首页自动为最新一篇7天内发布的文章添加"最新"标签。

功能特点

  • 在首页自动识别7天内发布的最新文章
  • 为符合条件的文章添加"最新"标签(仅第一篇)
  • 支持置顶文章显示"最新"标签
  • 可自定义判断天数
  • 自动注入默认 CSS 样式
  • 支持自定义 CSS 样式
  • 简单易用,配置灵活

安装方法

方法一:使用 npm

在您的 Hexo 博客根目录下执行以下命令:

npm install hexo-butterfly-new-post-tag --save

方法二:使用 Git

git clone https://github.com/yourusername/hexo-butterfly-new-post-tag.git node_modules/hexo-butterfly-new-post-tag

方法三:本地安装

  1. 下载本插件的所有文件
  2. 将文件复制到 Hexo 博客根目录的 node_modules/hexo-butterfly-new-post-tag/ 目录下

配置选项

在 Hexo 博客的配置文件 _config.yml 或主题配置文件 _config.butterfly.yml 中添加以下配置:

new_post_tag:
  # 是否启用插件
  enable: true
  # 判断最新文章的天数,默认为7天内
  days: 7
  # 插件优先级,默认为10
  priority: 10
  # 是否使用默认样式
  default_style: true
  # 自定义CSS设置
  custom_css:
    # 是否启用自定义CSS类名
    enable: false
    # 自定义CSS类名
    class_name: 'newPost'

## 使用说明

1. 安装完成并配置好后,插件会自动在 Hexo 启动时加载
2. 在首页,最新一篇符合条件的文章会自动显示"最新"标签
3. 如果置顶文章是在指定天数内发布的,也会显示"最新"标签
4. 如需修改判断天数,只需调整配置文件中的 `days` 参数
5. 如需禁用插件,将配置中的 `enable` 设置为 `false` 即可
6. 如需使用自定义 CSS 样式:
   - 将 `custom_css.enable` 设置为 `true`
   - 在 `custom_css.class_name` 中指定自定义 CSS 类名
   - 在您的博客中添加对应的 CSS 样式

## 注意事项

1. 本插件仅在首页显示"最新"标签
2. 每个页面只会显示一个"最新"标签(第一篇符合条件的文章)
3. 插件会在 Hexo 渲染模板时自动替换原始的 `indexPostUI.pug` 内容
4. 如果遇到问题,可以查看 Hexo 的运行日志获取更多信息

## 效果预览

在首页,符合条件的最新文章标题旁会显示"最新"标签。

## License

MIT

## 更新日志

### v1.0.0
- 初始版本发布
- 支持为指定天数内发布的最新文章添加"最新"标签
- 支持自定义判断天数
- 支持置顶文章显示"最新"标签