probberechts / hexo-theme-cactus

:cactus: A responsive, clean and simple theme for Hexo.
https://probberechts.github.io/hexo-theme-cactus/
MIT License
3.12k stars 774 forks source link

categories and tags index page not listing all tags and categories #35

Closed rishabh1403 closed 7 years ago

rishabh1403 commented 7 years ago

I have created a new categories page and provided type in font matter, still categories and tags index page is blank

probberechts commented 7 years ago

Could you provide more information? Which files did you create and what did you put in each file?

rishabh1403 commented 7 years ago

I took up the default helloworld.md file from hexo, and added tags in front-matter `

title: Hello World tags:

and I created a tags folder in source directory of hexo root project folder. Next I created a index.md inside that folder with following font-matter `

title: tags type: "tags" date: 2017-04-20 18:29:43

` still when I go to blogUrl/tags , I don't see list of all tags. You can find source code here https://github.com/rishabh1403/rishabh1403.github.io . Thanks for this awesome theme

probberechts commented 7 years ago

You just created a blank page. Your tags won't appear there automagically...

The simplest approach is to add the link to the archive page of each tag in the markdown of your tags page, eg:

---
title: tags
type: "tags"
date: 2017-04-20 18:29:43
---
[Example](/tags/example/)
[Foo](/tags/foo/)
[Bar](/tags/bar/)

If you want to do it dynamically, you will have to

  1. Create a view in layout/tags.ejs
  2. Add your code in with the site.tags variable
  3. Create a new page with hexo new page "tags"
  4. Add layout:"tags" in the front-matter of source/tags/index.md file.
rishabh1403 commented 7 years ago

thanks a ton!! works like a charm 👍