sumimakito/hexo-theme-Journal

tags的效果怎么才能实现示例的效果?

Opened this issue · 3 comments

我的tags总是空白的,而且会显示在侧边栏,但是我想实现示例的效果,怎么修改配置文件?

控制台那里没有路由到tag-index.ejs

用命令hexo new page "tags"新建一个页面.
然后编辑source/tags/index.md,替换为以下内容即可:

---
title: 标签
layout: tag-index
no_comments: true
---

其中,title可以自定义为任何内容.

分类页同理,需要将layout改为category-index.

側邊欄隱藏方案(不優雅版)
https://github.com/SumiMakito/hexo-theme-Journal/blob/master/layout/_include/side_nav.ejs#L19
直接添加條件判斷:

<% site.pages.each(function (page){ %>
       <% if(!page.hide){ %>
            <a class="a-block nav-link-item <%= is_current(page.path) && 'active' %>" href="<%= config.root + page.path %>">
                <%= page.title %>
            </a>
        <% }});} %>

并編輯source/tags/index.md,添加以下内容即可:

---
title: 標籤
layout: tag-index
hide: true
---