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

Taxonomies don't work for docs-only site #716

Closed
honzik20 opened this issue Oct 7, 2021 Discussed in #698 · 8 comments
Closed

Taxonomies don't work for docs-only site #716

honzik20 opened this issue Oct 7, 2021 Discussed in #698 · 8 comments

Comments

@honzik20
Copy link

honzik20 commented Oct 7, 2021

Discussed in #698

Originally posted by honzik20 September 20, 2021
The mostly docs concept is great but it doesn't play nicely with taxonomies.

If my content is under en/, the terms pages don't list any topics - it seems they're not picking up the correct template. I suspect this has to do with the way the template cascades.

If I keep docs under en/docs, it works - but that means I need a homepage.

I've created a repo based on mostlyDocs with taxonomies enabled (and submodules updated) to replicate the issue: https://github.com/honzik20/mostlyDocs

@honzik20 honzik20 changed the title Taxonomies and docs-only site doesn't work Taxonomies doesn't work for docs-only site Oct 7, 2021
@honzik20 honzik20 changed the title Taxonomies doesn't work for docs-only site Taxonomies don't work for docs-only site Oct 7, 2021
@mhincapie
Copy link

We are also having this same issue. We wouldn't like to have a homepage to make it work.

@gwatts
Copy link
Contributor

gwatts commented Nov 12, 2021

I'm planning on updating the mostlydocs site in the near term.. hoping to get at least #759 merged down into docsy first and then i'll look into issues like these too

@gwatts
Copy link
Contributor

gwatts commented Nov 14, 2021

Ok so there's a couple of things going on here:

  1. @honzik20 your config.toml for your example site is incorrect - you have the "taxonomyCloud" setting inside the "taxonomies" section which really confuses Hugo! It should actually be inside params.taxonomy - Changing that alone will make things start to work
  2. The top level cascade i have in /_index.md ends up applying the docs type to /tags/ etc taxonomy sections, which means it's using the wrong template.. There's a couple of ways of fixing that, but it might be that the simplest is an update to Hugo itself - See this thread that i opened there

Example correct configuration for config.toml:

#disableKinds = ["taxonomy", "taxonomyTerm"]

[taxonomies]
tag = "tags"
category = "categories"

[params.taxonomy]
taxonomyCloud = ["tags", "categories"]

once i figure out a good answer for supporting taxonomies generally i'll make a PR to update the template, but hopefully this puts you on the right track for now

@mhincapie
Copy link

@gwatts Looking forward to how taxonomies are supported. Thank you!

@gwatts
Copy link
Contributor

gwatts commented Nov 15, 2021

@mhincapie @honzik20 - Could you check out this PR and see if that helps you? gwatts/mostlydocs#3

@mhincapie
Copy link

@gwatts that pointed me in the right direction. Thank you so much 😄 . This is what worked for me in the _index.md file:

cascade:
- _target:
    path: "/**"
    kind: "page"
  type: "docs"
- _target:
    path: "/**"
    kind: "section"
  type: "docs"
- _target:
    path: "/**"
    kind: "home"
  type: "docs"

with the following config in the config.toml file:

[taxonomies]
tag = "tags"
category = "categories"

[params.taxonomy]
taxonomyCloud = ["tags", "categories"]

@gwatts
Copy link
Contributor

gwatts commented Nov 17, 2021

Thanks @mhincapie - I've merged down the mostlydocs PR now; tags are up and running there by default now - @honzik20 if all looks good would you like to close this ticket out?

@honzik20
Copy link
Author

Thanks for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants