Skip to content

use tags and categories in pages #1067

Open
@rhewitt22

Description

@rhewitt22

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.

Activity

DanielBaird

DanielBaird commented on Mar 2, 2015

@DanielBaird

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

simonwjackson

simonwjackson commented on Aug 17, 2015

@simonwjackson

I would also like this feature

added this to the 4.0 milestone on Apr 6, 2017
NSBum

NSBum commented on Apr 19, 2018

@NSBum

Another vote for this feature.

tomap

tomap commented on Sep 15, 2018

@tomap
Contributor

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

NSBum commented on Sep 15, 2018

@NSBum

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

noraj commented on Jan 5, 2020

@noraj
Contributor

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

curbengh commented on Jan 10, 2020

@curbengh
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

noraj commented on Apr 14, 2020

@noraj
Contributor

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

5 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @DanielBaird@tomap@simonwjackson@leesei@rhewitt22

      Issue actions

        use tags and categories in pages · Issue #1067 · hexojs/hexo