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

invalid image links for baseURL with subdirectory and relativeURLs=true #12130

Open
McShelby opened this issue Feb 23, 2024 · 1 comment
Open

Comments

@McShelby
Copy link

McShelby commented Feb 23, 2024

As discussed in the forum, there is a regression when generating image links between 0.123 and previous versions in a multilang setup if a baseURL other than / and relativeURLs=true are given.

The markdown image link to the bundles's resource:

![kitten](a.jpg)

results in in broken link (one step up is missing)

<img alt="kitten" src="../../foo/en/s1/a.jpg">

while in previous versions it was

<img src="a.jpg" alt="kitten">

Thanks to @jmooring for the example repo

From the discussion, it's unclear if this is a bug or (because of the used option combination) is undefined behavior.

@jmooring
Copy link
Member

To clarify, going as far back as v0.54.01, this combination has never worked with either monolingual or multilingual sites:

baseURL = 'https://example.org/foo/'   <-- includes subdirectory
relativeURLs = true

So then people got "clever" and started making URLs both relative and canonical at the same time (sigh):

baseURL = 'https://example.org/foo/'   <-- includes subdirectory
relativeURLs = true
canonifyURLs = true

And in some cases that helped, probably due to luck more than anything else.

Footnotes

  1. I didn't bother testing anything earlier.

Kapusch added a commit to Kapusch/blog-dotnet-maui that referenced this issue Mar 30, 2024
Stick to Hugo version 0.122.0 in CI/CD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants