hexo-theme-ace
hexo-theme-ace copied to clipboard
请问如何生成tags和categories?
文章都带有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吗?
哦。已解决。
把souce/tags/index.md中的内容改成:
---
title: tags
date: 2019-10-23 09:41:27
type: tags
layout: "tags"
---
tags就正常了。
tags是可以了。但categories还是不行。
无论点击哪个categorie,显示的都是所有页面的列表。
try to add this:
category: yourcat
请问你的分类是怎么出来的啊 `--- title: 文章分类 date: 2019-12-27 15:15:35 type: categories layout: "categories"
` 这样出不来
再加一句: category: yourcat
弄好了,非常感谢,谢谢您的回答!
@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
---
你的category叫什么名字? categories?
想问问category: yourcat应该怎么加,yourcat代表什么,谢谢
@kinggozhang 能让我参考一下您博客的tags和categories文件的配置吗
举例,现在我要生成一个hexo 的category 1,
hexo new page hexo
这时候会生成source/hexo/index.md 编辑这个文件,在文件头添加:
category: hexo
- 新建博文
hexo new blog1
这时候生成source/_posts/blog1.md 编辑这个文件,文件头添加:(或者使用hexo-admin)
categories:
- hexo
就可以了。。
哦哦,谢谢帮助
在 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.
你的category叫什么名字? categories?
您好,我的问题是发现category是按照archive.ejs生成的,但是我使用官方的landscape主题没有问题,我把ace和landscape对比了下,发现hexo-theme-ace/layout/categories.ejs文件的命名不同,然后我把文件名修改成category.ejs就可以了,您可以测试验证一下。
对的,hexo有个适配优先级,优先用categories.ejs。 谢谢告知