hexo
hexo copied to clipboard
use tags and categories in pages
Is there a specific reason for preventing pages from using tags/categories? It seems as if they are useful methods for relating content in cases where the site is larger than a standard tech blog.
I also would like to use categories and tags on pages.
I would also like this feature
Another vote for this feature.
I believe this issue might be old, because I just tested with hexo with the following version: "hexo": "^3.7.1", "hexo-generator-archive": "^0.1.5", "hexo-generator-category": "^0.1.3", "hexo-generator-index": "^0.2.1", "hexo-generator-tag": "^0.2.0",
And you can use both:
And the documentation display an example with both here: https://hexo.io/docs/front-matter#Categories-amp-Tags
Or am I misunderstanding your question? (Note that I believe this will depend on the capabilities of your theme. I was using the default theme https://github.com/hexojs/hexo-theme-landscape )
Can we close this issue?
I have the same configuration, same theme but cannot generate tags or categories on pages (i.e. layout: page
in front matter). I can do so on posts (layout: post
in front matter.) Can you confirm that the above were generated on pages, not posts?
5 years later
Issue
If post
is a page
sub-category, page should be able to use tags
and categories
too. It should be up to the theme to decided if they want to include tags and categories for pages in their layout or not.
Actually not being able to use tags on something else than layout: post
prevent a theme creator from using the list_tags
helper on a page for example.
IF there is a technical reason please explain why, else just let enable tags and categories for every single layout: page, post (page), custom layout base on page, etc.
non working workaround
With pug and bulma I tried to achieve the same thing as list_tags(site.tags, {show_count: false, class: 'tag is-primary escape', style: false, separator: ''})
if page.tags
div(class="level-item has-text-centered")
div(class="tags")
each tag in page.tags
a(class="tag is-primary" href="/tags/post/" + tag rel="tag")
= tag
The display part works perfectly but the problem is that the /tags/post/taghere/
doesn't exist because it's generated for post only and /tags/page/taghere/
doesn't exist either.
Context
I am creating a theme for documentation, where I created a doc
layout that inherits the page layout.
The whole idea of the project in the first place was to make a statigen focused documentation where with tags support because there are many documentation staticgen but none has tags support.
Until this issue is fixed my project is ruined because I can't use tags on something else than a post. Else I should begin back from scratch with middleman, nanoc or jekyll.
IF there is a technical reason please explain why, else just let enable tags and categories for every single layout: page, post (page), custom layout base on page, etc.
I just briefly looked into the difference between page and post. page lacks an ID to link to a tag's ID.
It seems possible for page to have tag/category, once it has ID in its model and the necessary plumbing.
Any chance to have this feature in the next release ? :smiley:
Has someone the skill to complete this PR #4560 ?
- [x] Tags for pages support in Docusaurus https://docusaurus.io/feature-requests/p/add-tags-to-pages
- [x] Tags for pages support in Retype https://github.com/retypeapp/retype/releases/tag/v1.6.0
- [ ] Tags for pages support in Hexo