Skip to content

Conversation

@sammedhi
Copy link

@sammedhi sammedhi commented Aug 10, 2025

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

Fix the figure shortcode for multilingual site

The figure shortcode now use RelPermalink instead of the link provided by the user. Using the link provided by the user caused the image not to load when using local url for translated the site was translated. When you translated the site the url is modified (eg: site/fr/post/article/), if you tried to load the image located at "site/post/article/img.png" using {{<figure src="img.png" >}} the image would not load since the resulting link would be "site/fr/post/article/img.png".

This would not work for site using translation by file name https://gohugo.io/content-management/multilingual/#translation-by-file-name

Which is inconsistent with the markdown behaviour where local path works fine.

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

No, it just happened that the default hugo shortcode was working while the paperMod's one was not loading my image on my translated pages

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.

…by using the RelPermalink instead of the local link, this caused the image not to load when the site was translated and the url was modified (eg: site/fr/post/article/) and you tried to load the image at site/post/article/img.png since the resulting link would be myamazingsite/fr/post/article/img.png
@sonarqubecloud
Copy link

gijoe88 added a commit to gijoe88/hugo-PaperMod that referenced this pull request Aug 13, 2025
After viewing PR adityatelange#1777 , replacing absolute links by relative links, and also replace the usage of src parameter in the non responsive case
@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.

1 participant