docsy icon indicating copy to clipboard operation
docsy copied to clipboard

taxonomies multi-language bug at page header

Open BrentHuang opened this issue 1 year ago • 2 comments

Environment

  • [x] Version of Docsy you are using: v0.10.0
  • [ ] How are you using Docsy? As a:
    • [x] Hugo module
    • [ ] NPM module
    • [ ] Git submodule
    • [ ] Other:
  • [x] Version of Hugo you are using (output of hugo version): v0.134.1
  • [ ] OS:
    • [x] Linux (WSL)
    • [ ] macOS
    • [ ] Windows
    • [ ] Other:

Problem

image

config in hugo.toml

# Comment out to enable taxonomies in Docsy
# disableKinds = ["taxonomy", "taxonomyTerm"]

# You can add your own taxonomies
[taxonomies]
tag = "tags"
category = "categories"

[params.taxonomy]
# set taxonomyCloud = [] to hide taxonomy clouds
taxonomyCloud = ["tags", "categories"]

# If used, must have same length as taxonomyCloud
# taxonomyCloudTitle = ["Tag Cloud", "Categories"]
taxonomyCloudTitle = ["标签", "分类"]

# set taxonomyPageHeader = [] to hide taxonomies on the page headers
taxonomyPageHeader = ["tags", "categories"]

BrentHuang avatar Sep 09 '24 01:09 BrentHuang

The issue title is misleading: this is not a bug report, this issue is more like a question how to show taxonomies in the page header in a language different from English. This can be achieved via correct configuration parameters in your hugo.toml:

config in hugo.toml ...

Use this configuration instead:

# Comment out to enable taxonomies in Docsy
# disableKinds = ["taxonomy", "taxonomyTerm"]

# You can add your own taxonomies
[taxonomies]
标签 = "Plural form of 标签"
分类 = "Plural form of 分类"

[params.taxonomy]
# set taxonomyCloud = [] to hide taxonomy clouds
taxonomyCloud = ["tags", "categories"]

# If used, must have same length as taxonomyCloud
# taxonomyCloudTitle = ["Tag Cloud", "Categories"]
taxonomyCloudTitle = ["标签", "分类"]

# set taxonomyPageHeader = [] to hide taxonomies on the page headers
taxonomyPageHeader = ["标签", "分类"]

In the frontmatter of your pages, use this:

---
title: "Temperatura"
Plural form of 标签: [your categories]
Plural form of 分类: [your tags]
---

Then you should be see the page headers in Chinese as desired. Does this resolve your issue?

deining avatar Sep 10 '24 10:09 deining

thank you .

not resolved, and it looks weird and cumbersome.

Can't there be a taxonomyPageHeaderTitle? taxonomyPageHeaderTitle = ["标签", "分类"]

BrentHuang avatar Sep 11 '24 03:09 BrentHuang