hugo-scroll/exampleSite/content/en/homepage/about-me.de.md
Daniel Holbach 6264a749df fix typos, make markdownlint happy
Signed-off-by: Daniel Holbach <daniel.holbach@gmail.com>
2024-07-11 09:23:53 +02:00

2.1 KiB

title weight header_menu
Über mich (shared folder) 3 true

This demonstates localized variants about-me.de.md placed along the primary language content, such as content/en. Both localisation approaches (separate folder, suffixes in the same folder) can be used and mixed.

Local content

When localised page variants are placed along, images of other languages can't be used directly. You would need to use .de-suffixed copy of the image: ![Jane Doe](en-happy-ethnic-woman-sitting-at-table-with-laptop-3769021.de.jpg) Consider using assets instead.

Images from local content location can't be pipeline-processed.

Static

Alternatively, images can be injected from static/images: Jane Doe Note the leading / is required in this case. Images from static location can't be pipeline-processed and are always copied when publishing the site, even if not linked from any page.

Assets

Latest Hugo version supports injection from assets via natural Markdown notation, which empowers this approach for injecting images since pipeline processing (resizing etc) can be used. However, It only worked for me with the local test deployment, there were issues while deploying previews Netlify. Possible workaround would be to use custom shortcode to "touch" the image via Resources.GetMatch. I hope this gets fixed someday.

Broken image from assets Historically, Linking image from assets folder worked only via Hugo-specific shortcode, there was a discussion with suggestions.

Note that using images form assets folder is the only way to apply pipeline processing, such as resizing, when building the site. Fore more details, read about asset vs static difference

Assets are only published if linked from a content page.