Hexo Next如何置顶文章

安装hexo-math

参考Netcan_Space博客

安装hexo-generator-index-pin-top,然后在Front-matter中加上top: true即可.

\themes\next\layout\_macropost.swig下修改修改相应的效果。

Next主题自带Frongt-matter中使用Sticky: true的方式添加指定效果,但是在这篇博文写作的时候该方法只会将文章置顶到某一个页面的最上方。如果你的首页博客是一页最多显示10篇,而从时间上你要指定的文章排在第15篇,那么设定sticky会导致你的文章在/page/2中被置顶。

本博客使用的置顶效果是在post-sticky-flagpost-title-link之间加入

1
2
3
4
5
{% if post.top > 0 %}
<span class="post-top-flag" title="top">
<font color="red">[置顶]</font>
</span>
{% endif %}
-------------End. Thank u for reading.-------------
0%