Skip to content

Conversation

valnaumov
Copy link

Fixes image URL for multilingual sites when the image resource is only defined for the default language.

What does this PR change? What problem does it solve?

PaperMod defines a custom figure shortcode which currently fails to provide a valid link in a multilingual site. As stated in Hugo docs, we should be able to use image resources from any page bundle.

The old shortcode uses the img src as is without searching for the resource in other page bundles. See the linked issue for an example.

Was the change discussed in an issue or in the Discussions before?

Closes #1624

PR Checklist

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

Fixes image URL for multilingual sites when the image resource is only defined for the default language.
Copy link

gijoe88 added a commit to gijoe88/hugo-PaperMod that referenced this pull request Aug 13, 2025
Add comments to the code, and take url parsing from adityatelange#1651. Hope @valnaumov will forgive me.
@gijoe88 gijoe88 mentioned this pull request Aug 13, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: figure short code is not working properly for multilingual websites
1 participant