安装插件
 安装
在安装之前,先卸载官方的插件,否则会引起冲突。
1 2 3 4
   |  $ npm uninstall hexo-generator-index
  $ npm install hexo-generator-index-custom --save
 
  | 
 
 配置
在 [you_blog] 根目录下修改_config.butterfly.yml中添加以下配置:
1 2 3 4 5
   | index_generator:   path: ''   per_page: 10   order_by: -date   pagination_dir: page
   | 
 
 修改侧边栏最近发布
修改 [you_blog]\Blog\themes\butterfly\layout\includes\widget\card_recent_post.pug
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
   | if theme.aside.card_recent_post.enable   .card-widget.card-recent-post     .item-headline       i.fas.fa-list-ol       span= _p('aside.card_recent_post')     .aside-list       - let postLimit = theme.aside.card_recent_post.limit        ……         - let link = article.link || article.path         …… +          if article.hide !== true             if post_cover && theme.cover.aside_enable               a.thumbnail(href=url_for(link), target='_blank', title=title)                 img(src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)             .content               a.title(href=url_for(link), target='_blank', title=title)= title
 
   | 
 
 修改文章
在 md 文章的头部信息中添加 hide: true
1 2 3 4 5 6
   | --- title: 首页的文章隐藏 author: 悦惜等风 date: 2023-11-28 21:48:33 hide: true ---
   | 
 
 参考链接
插件 GitHub 地址: hexo-generator-index-custom
Zhheo: Hexo 的 Butterfly 下如何隐藏部分文章不在首页显示
本文章根据:雷雷屋头编写,感谢雷雷屋头