Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use tags and categories in pages #1067

Open
rhewitt22 opened this issue Feb 26, 2015 · 10 comments · May be fixed by #4560
Open

use tags and categories in pages #1067

rhewitt22 opened this issue Feb 26, 2015 · 10 comments · May be fixed by #4560

Comments

@rhewitt22
Copy link

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.

@DanielBaird
Copy link

I also would like to use categories and tags on pages.

@simonwjackson
Copy link

I would also like this feature

@NoahDragon NoahDragon added this to the 4.0 milestone Apr 6, 2017
@NoahDragon NoahDragon mentioned this issue Apr 6, 2017
53 tasks
@NSBum
Copy link

NSBum commented Apr 19, 2018

Another vote for this feature.

@tomap
Copy link
Contributor

tomap commented Sep 15, 2018

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:
image

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?

@NSBum
Copy link

NSBum commented Sep 15, 2018

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?

@noraj
Copy link
Contributor

noraj commented Jan 5, 2020

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.

@curbengh
Copy link
Contributor

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.

@noraj
Copy link
Contributor

noraj commented Apr 14, 2020

Any chance to have this feature in the next release ? 😃

@noraj
Copy link
Contributor

noraj commented May 29, 2021

Has someone the skill to complete this PR #4560 ?

@noraj
Copy link
Contributor

noraj commented Oct 16, 2021

@uiolee uiolee changed the title Why can't pages use tags and categories? feat request: use tags and categories in pages Oct 13, 2023
@uiolee uiolee changed the title feat request: use tags and categories in pages use tags and categories in pages Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants