hexo-theme-ace icon indicating copy to clipboard operation
hexo-theme-ace copied to clipboard

请问如何生成tags和categories?

Open araisann opened this issue 5 years ago • 14 comments

文章都带有tags和categories。
使用默认的landscape主题,tags和categories点进去都能正常展示。

换成hexo-theme-ace后,侧栏点击某个tag,显示404。
点击某个categories,则显示全部页面。

网上都是说 hexo new page tags

然后编辑创建的souce/tags/index.md

---
title: tags  
date: 2016-11-11 21:40:58  
type: "tags"  
---

但结果点击某个tag,展示的是空白页面。 categories用这种方式情况未变。

是要自己怎么配置tags和categories吗?

araisann avatar Oct 23 '19 01:10 araisann

哦。已解决。
把souce/tags/index.md中的内容改成:

---
title: tags
date: 2019-10-23 09:41:27
type: tags
layout: "tags"
---

tags就正常了。

araisann avatar Oct 23 '19 02:10 araisann

tags是可以了。但categories还是不行。
无论点击哪个categorie,显示的都是所有页面的列表。

araisann avatar Oct 23 '19 02:10 araisann

try to add this:

category: yourcat

kinggozhang avatar Oct 26 '19 07:10 kinggozhang

请问你的分类是怎么出来的啊 `--- title: 文章分类 date: 2019-12-27 15:15:35 type: categories layout: "categories"

` 这样出不来

cheng521521 avatar Dec 27 '19 08:12 cheng521521

再加一句: category: yourcat

kinggozhang avatar Jan 02 '20 09:01 kinggozhang

弄好了,非常感谢,谢谢您的回答!

cheng521521 avatar Jan 07 '20 07:01 cheng521521

@kinggozhang 请问下categories的问题能具体说下怎么加吗?我这里加上了还是不行。 我看了下生成后的public目录下的public\categories\test\index.html文件,感觉像是按照archive.ejs生成的。 我的配置如下

---
title: categories
date: 2020-01-17 11:30:08
type: categories
layout: "categories"
category: categories
---

sandrewzq avatar Jan 17 '20 08:01 sandrewzq

你的category叫什么名字? categories?

kinggozhang avatar Mar 16 '20 13:03 kinggozhang

想问问category: yourcat应该怎么加,yourcat代表什么,谢谢

xiao-gy avatar Apr 04 '20 15:04 xiao-gy

@kinggozhang 能让我参考一下您博客的tags和categories文件的配置吗

xiao-gy avatar Apr 05 '20 07:04 xiao-gy

举例,现在我要生成一个hexo 的category 1,

hexo new page hexo

这时候会生成source/hexo/index.md 编辑这个文件,在文件头添加:

category: hexo
  1. 新建博文
hexo new blog1

这时候生成source/_posts/blog1.md 编辑这个文件,文件头添加:(或者使用hexo-admin)

categories:
- hexo

就可以了。。

kinggozhang avatar Apr 05 '20 07:04 kinggozhang

哦哦,谢谢帮助

在 2020年4月5日,下午3:53,kinggozhang [email protected] 写道:

举例,现在我要生成一个hexo 的category 1, hexo new page hexo 这时候会生成source/hexo/index.md 编辑这个文件,在文件头添加: category: hexo 2. 新建博文 hexo new blog1 这时候生成source/_posts/blog1.md 编辑这个文件,文件头添加:(或者使用hexo-admin) categories:

hexo 就可以了。。

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kinggozhang/hexo-theme-ace/issues/6#issuecomment-609375136, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK4JGH5EJMZ6JBKV5HF7ILTRLA2HTANCNFSM4JD2T2VQ.

xiao-gy avatar Apr 06 '20 13:04 xiao-gy

你的category叫什么名字? categories?

您好,我的问题是发现category是按照archive.ejs生成的,但是我使用官方的landscape主题没有问题,我把ace和landscape对比了下,发现hexo-theme-ace/layout/categories.ejs文件的命名不同,然后我把文件名修改成category.ejs就可以了,您可以测试验证一下。

sandrewzq avatar Jun 10 '20 02:06 sandrewzq

对的,hexo有个适配优先级,优先用categories.ejs。 谢谢告知

kinggozhang avatar Jun 12 '20 02:06 kinggozhang