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

One file generates two pages and is duplicated in categories, tags and archives. #12685

Closed
note4 opened this issue Jul 28, 2024 · 4 comments
Closed

Comments

@note4
Copy link

note4 commented Jul 28, 2024

image

一个文件生成两个页面,并且在分类、标签和归档中重复出现。
One file generates two pages and is duplicated in categories, tags and archives.

内容会自动重复生成,且路径不同,如果配置了 url 就会有路径和内容一样的两个页面。config.yml配置如下:

The content will be automatically duplicated sheng generation, and the path is different, if you configure the url will have the same path and content of the two pages. config.yml configuration is as follows:


defaultContentLanguage: zh
defaultContentLanguageInSubdir: false

taxonomies:
  category: categories
  tag: tags
  series: series

permalinks:
  posts: "/log/:filename/"
  categories: "/:slug/"
  tags: "/tags/:slug/"
  series: "/series/:slug/"
  
languages:
  zh:
    languageName: "中文"
    weight: 1
    contentDir: "content/zh"

文件路径如下:
The file path is as follows:
image

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.121.1+extended darwin/amd64 BuildDate=unknown VendorInfo=macports

Does this issue reproduce with the latest release?

Yes

@bep bep added this to the v0.131.0 milestone Jul 30, 2024
@note4
Copy link
Author

note4 commented Aug 5, 2024

@bep

发现一个问题,不改变以下配置:
Found a problem without changing the following configuration:

defaultContentLanguage: zh
defaultContentLanguageInSubdir: false

languages:
  zh:
    languageName: "中文"
    weight: 1
    contentDir: "content/zh"

如果将中文内容存放路径为content\zh\posts会将同一内容生成两次。

If you change the path of Chinese content to content\zh\posts, the same content will be generated twice.

如果将中文内容存放路径改为content\posts就不会将同一内容生成2次。

If you change the Chinese content path to content\\posts, the same content will not be generated twice.

测试环境 hugo 版本:

Test environment hugo version:

Windows 11 hugo v0.127.0-74e0f3bd63c51f3c7a0f07a7c779eec9e922957e+extended windows/amd64 BuildDate=2024-06-05T10:27:59Z VendorInfo=gohugoio

macOS 130

@note4
Copy link
Author

note4 commented Aug 7, 2024

然后最近发现在同样的 hugo 版本下,hugo-PaperMod 主题会有这个问题,而 hugo-theme-stack 主题没有该问题。

Then I recently discovered that under the same hugo version, the hugo-PaperMod theme has this problem, but the hugo-theme-stack theme does not have this problem.

@jmooring
Copy link
Member

jmooring commented Aug 8, 2024

From what I can gather, this problem is specific to the PaperMod theme. See adityatelange/hugo-PaperMod#1569.

@jmooring jmooring closed this as completed Aug 8, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants