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

Remove the language id from page resources when publishing multilingual page bundles #9557

Closed
jmooring opened this issue Feb 24, 2022 · 3 comments

Comments

@jmooring
Copy link
Member

jmooring commented Feb 24, 2022

I am not sure if this is (a) a defect, (b) an improvement, or (c) a dumb idea.

content structure

content/about
├── example.es.png
├── example.png
├── index.es.md
└── index.md

content/about/index.md

![](example.png)

content/about/index.es.md

![](example.png)   <-- user wants to exclude language id from image name, for a very good reason

Build the site

public/
├── about/
│   ├── example.png
│   └── index.html
├── es/
│   ├── about/
│   │   ├── example.es.png  <-- could/should this be named example.png instead?
│   │   └── index.html
│   └── index.html
└── index.html

With this setup, the img element in public/es/about/index.html refers to a non-existent path:

<img src="example.png" alt="">

The proposed solution is to remove the language id from page resources when publishing multilingual page bundles. This is not limited to images; it would be applied to all page resources.

We have made this setup work with an image render hook that falls back to a language-specific resource, but it seems like we shouldn't have to do this. Maybe.

Minimal reproducible example:

git clone --single-branch -b hugo-github-issue-9557 https://github.com/jmooring/hugo-testing hugo-github-issue-9557
cd hugo-github-issue-9557
hugo
tree public
grep img public/es/about/index.html

Reference: https://discourse.gohugo.io/t/multi-language-images-and-page-bundles/37325

@bep
Copy link
Member

bep commented Feb 24, 2022

There is another issue about this (somewhere), I even have a branch with a fix -- but that branch needs some ... ehhm... more work.

@bep bep modified the milestones: v0.95.0, v0.96.0 Mar 9, 2022
@bep bep modified the milestones: v0.96.0, v0.97.0 Mar 24, 2022
@bep bep modified the milestones: v0.97.0, v0.98.0 Apr 13, 2022
@bep bep modified the milestones: v0.98.0, v0.99.0 Apr 28, 2022
@bep bep modified the milestones: v0.99.0, v0.100.0 May 24, 2022
@bep bep modified the milestones: v0.100.0, v0.101.0 May 31, 2022
@bep bep modified the milestones: v0.101.0, v0.102.0 Jun 16, 2022
@bep bep modified the milestones: v0.102.0, v0.103.0 Aug 28, 2022
@bep bep modified the milestones: v0.103.0, v0.104.0 Sep 15, 2022
@bep bep modified the milestones: v0.104.0, v0.105.0 Sep 23, 2022
@bep bep modified the milestones: v0.105.0, v0.106.0 Oct 26, 2022
jmooring added a commit to jmooring/hugo-testing that referenced this issue Nov 13, 2022
Requires an image render hook to workaround:
gohugoio/hugo#9557
jmooring added a commit to jmooring/hugo-testing that referenced this issue Nov 13, 2022
Requires an image render hook to workaround:
gohugoio/hugo#9557
jmooring added a commit to jmooring/hugo-testing that referenced this issue Nov 13, 2022
Requires an image render hook to workaround:
gohugoio/hugo#9557
@bep bep removed this from the v0.106.0 milestone Nov 18, 2022
@bep bep modified the milestones: v0.110.0, v0.111.0 Jan 26, 2023
@bep bep modified the milestones: v0.111.0, v0.112.0 Feb 15, 2023
@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
@bep bep modified the milestones: v0.113.0, v0.115.0 Jun 13, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 5, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@jmooring
Copy link
Member Author

Duplicate of #7437.

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 Feb 14, 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

2 participants