You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All my URLs are prepended with a /en/ language code.
This usually works fine, but the attachments shortcode creates links that do not contain the language code and simply reply with "Page Not Found'.
One such generated link is http://localhost:1313/sdks/backend/java/security.en.files/application.yml, whereas the attached file is available at http://localhost:1313/en/sdks/backend/java/security.en.files/application.yml.
I found out that I could fix this for my use case with the following change. Would it make sense to have this change in the theme?
The text was updated successfully, but these errors were encountered:
McShelby
changed the title
attachments: links are incorrect when "defaultContentLanguageInSubdir": true
attachments: fix incorrect links for defaultContentLanguageInSubdir=true
Dec 23, 2022
The non-standard conformant way the attachments shortcode was implemented (see #22 for plans to fix this) leads to some quirks.
Eg. Hugo stores the attachments only for leaf bundles in their corresponding language subdirectory (plus also storing them in the subdirectory of the default language). All other page types store the attachments only in the subdirectory of the default language.
So our generated links always have to point into the subdirectory of the default language.
Hello,
I configured my site with an exotic option :-)
All my URLs are prepended with a
/en/
language code.This usually works fine, but the
attachments
shortcode creates links that do not contain the language code and simply reply with "Page Not Found'.One such generated link is
http://localhost:1313/sdks/backend/java/security.en.files/application.yml
, whereas the attached file is available athttp://localhost:1313/en/sdks/backend/java/security.en.files/application.yml
.I found out that I could fix this for my use case with the following change. Would it make sense to have this change in the theme?
Best,
Arnaud
The text was updated successfully, but these errors were encountered: