-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(category tag): add support to category tag in index and post page
Feat: 1. Now category tag can be displayed in index and post page. 2. Set `comments: false` to disable comment in specified post. 3. Set `sticky: ${num}` to show top article in index page. Change: 1. Scroll switch point is selected between the top image and the container. Fix: 1. Fix suddenly disappear of sidebar, caused by quick click on open menu button. 2. Fix known style sheet issues. Chore: 1. Use `const` to make JavaScript code more clever. 2. Improve mobile experience. 3. Update docs.
- Loading branch information
Showing
32 changed files
with
259 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
<div class= <%- className %> > | ||
<% if (theme.show_categories && currPost.categories.length) { %> | ||
<% let postCategory = '' %> | ||
<% currPost.categories.forEach((c) => { %> | ||
<% postCategory += `${c.name}/` %> | ||
<% }) %> | ||
<% postCategory = postCategory.slice(0, -1) %> | ||
<span class="post-category" data-categories="<%- postCategory %>""> | ||
<i class="far fa-folder post-category-icon"></i> | ||
<span class="post-category-text"> | ||
<%- postCategory %> | ||
</span> | ||
</span> | ||
<% } %> | ||
<% currPost.tags.forEach(function (tag, i) { %> | ||
<a class="post-tag" href="javascript:void(0);" data-tags = "<%- tag.name %>"><%- tag.name %></a> | ||
<a class="post-tag" href="javascript:void(0);" data-tags="<%- tag.name %>"><%- tag.name %></a> | ||
<% }) %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,15 @@ | ||
<div class="sidebar-panel-tags"> | ||
<div class="sidebar-tags-name"> | ||
<% site.tags.each(function (tag) { %> | ||
<span class="sidebar-tag-name" data-tags="<%- tag.name %>"><span class="iconfont-archer"></span><%- tag.name %></span> | ||
<span class="sidebar-tag-name" data-tags="<%- tag.name %>"> | ||
<span class="iconfont-archer"></span> | ||
<%- tag.name %> | ||
</span> | ||
<% }) %> | ||
</div> | ||
<div class="iconfont-archer sidebar-tags-empty"></div> | ||
<div class="tag-load-fail" style="display: none; color: #ccc; font-size: 0.6rem;"> | ||
缺失模块。<br/> | ||
1、请确保node版本大于6.2<br/> | ||
2、在博客根目录(注意不是archer根目录)执行以下命令:<br/> | ||
<span style="color: #f75357; font-size: 1rem; line-height: 2rem;">npm i hexo-generator-json-content --save</span><br/> | ||
3、在根目录_config.yml里添加配置: | ||
<pre style="color: #787878; font-size: 0.6rem;"> | ||
jsonContent: | ||
meta: false | ||
pages: false | ||
posts: | ||
title: true | ||
date: true | ||
path: true | ||
text: false | ||
raw: false | ||
content: false | ||
slug: false | ||
updated: false | ||
comments: false | ||
link: false | ||
permalink: false | ||
excerpt: false | ||
categories: true | ||
tags: true | ||
</pre> | ||
缺失模块,请参考主题文档进行安装配置:https://github.com/fi3ework/hexo-theme-archer#%E5%AE%89%E8%A3%85%E4%B8%BB%E9%A2%98 | ||
</div> | ||
<div class="sidebar-tags-list"></div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.