Open zhang-stephen opened 1 year ago
@zhang-stephen
Currently, the hexo-generator-index
doesn't have such an option, but hexo themes can implement this very easily! Here is an example with .ejs
:
<!-- Post List -->
<% page.posts.each((post) => { %>
<!-- Post Entry -->
<%- partial('_partial/post-entry', { post }) %>
<% }); %>
<!-- Post List -->
<% page.posts.each((post) => { %>
<!-- Post Entry -->
+ <% if (post.hidden !== true) { %>
<%- partial('_partial/post-entry', { post }) %>
+ <% } %>
<% }); %>
Is it possible to add an option, e.g.
hidden: true
, into front matter, and to remove this post from the index page?