Hello,
I use HUGO for an online help site
the default language is French, but there’s also an English version
in the English version, the page content appears but not the images
the tree structure is
content
_index.fr.md
_index.en.md
content/timeline
_index.fr.md
_index.en.md
geolocation.fr.md
geolocation.en.md
content/timeline/geolocation
geo1.jpg
geo2.jpg
Configuration
languageCode = "en-FR
defaultContentLanguage = "fr
[Languages.en]
title = "documentation"
weight = 2
languageName = "English"
contentDir = "content"
landingPageURL = "/en"
landingPageName = "<i class='fas fa-home'></i> Home"
Do you have any idea why the images in the English version are not displayed?
Thanks in advance.
Sincerely
Ana
iaeiou
August 9, 2023, 8:05am
2
Hi @schwartz and welcome on this forum,
Is there a public Git repository hosting your code somewhere?
This would help you get relevant advice here.
See this page for detailed guidance.
First thanks for your response.
our deposit is not public yet
This means that you can’t help me ?
Ana
Assuming that you are (a) inserting the images using markdown, and (b) not using an image render hook, then…
With this content structure:
content/
├── timeline/
│ ├── _index.en.md
│ ├── _index.fr.md
│ ├── geo1.jpg
│ ├── geo2.jpg
│ ├── geolocation.en.md
│ └── geolocation.fr.md
├── _index.en.md
└── _index.fr.md
And this site configuration:
defaultContentLanguage = 'fr'
defaultContentLanguageInSubdir = true
[languages.fr]
languageCode = 'fr-FR'
languageDirection = 'ltr'
languageName = 'Français'
title = 'My Title (fr)'
weight = 1
[languages.en]
languageCode = 'en-US'
languageDirection = 'ltr'
languageName = 'English'
title = 'My Title (en)'
weight = 2
Your markdown in both geolocation.fr.md and geolocation.en.md should be:
![geo1](../geo1.jpg)
![geo2](../geo2.jpg)
If you need additional assistance, post a link to the public repository for your project.
See Requesting Help .
Let us see your code
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Hello,
Thanks for your reply.
I did indeed have a problem with the location of the files in the English version.
Thank you very much and have a nice day.
Ana
system
Closed
August 12, 2023, 9:29am
6
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.