推荐直接试用置顶后的插件,使用以下命令:
bashnpm uninstall hexo-generator-index --save npm install hexo-generator-index-pin-top --save
然后在需要置顶的文章中加上top: true
即可。
例如:
js---
title: hexo设置文章顶置
date: 2020-01-25 20:30:49
tags: [hexo]
categories: hexo
top: true
---
还可以设置置顶标志
打开 /theme/next/layout/_macro
下的post.swig
文件,在<div class-"post-meta">
下,插入:
js{% if post.top %}
<i class="fa fa-thumb-tack"></i>
<font color=7D26CD>置顶</font>
<span class="post-meta-divider">|</span>
{% endif %}
效果如图
本文作者:mereith
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!