gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.38k stars 7.49k forks source link

Don't duplicate page resource output per language #11453

Closed bep closed 8 months ago

bep commented 1 year ago

We're planning on some big improvements for the next Hugo. A part of that is to make Hugo simpler and more effective in the way we handle content, also to pave away for features going forward. And with that comes some changes which some may consider breaking, more would consider bug fixes.

Given this example content folder and 2 languages defined:

content
└── mybundle
    ├── data.en.json
    ├── index.en.md
    ├── index.no.md
    └── sunset.en.jpg

In the current version of Hugo we would duplicate the output so you would get:

public
├── en
│   └── mybundle
│       ├── data.json
│       ├── index.html
│       └── sunset.jpg
└── no
    └── mybundle
        ├── data.json
        ├── index.html
        └── sunset.jpg

The original implementation of the above preceded render hooks and the main motivation was that you should be able to have links that worked both on GitHub and when rendered in Hugo, even across languages.

We would still be able to apply language specific params/name/title per resource, but .RelPermalink would point to the same file. If you need a different file for a given language, you can easily create a language specific version (e.g. data.no.json).

There's several reasons why the above is a great idea:

jmooring commented 1 year ago

Related: https://github.com/gohugoio/hugo/issues/9557

github-actions[bot] commented 8 months ago

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.