Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non localized files missing in not default language #292

Open
brospars opened this issue Feb 7, 2024 · 3 comments
Open

Non localized files missing in not default language #292

brospars opened this issue Feb 7, 2024 · 3 comments

Comments

@brospars
Copy link

brospars commented Feb 7, 2024

I recently upgraded to the latest version of this plugin and some of my links are broken because non localized files are not copied in other languages :

docs_dir
├── index.fr.md
├── index.en.md
├── topic1
│   ├── custom_data_file.csv
│   ├── index.en.md
│   └── index.fr.md

Will do :

site
├── fr
│   ├── index.html
│   ├── topic1
│   │   ├── custom_data_file.csv
│   │   └── index.html
├── index.html
├── topic1
│   └── index.html

Where previsously it was :

site
├── fr
│   ├── index.html
│   ├── topic1
│   │   ├── custom_data_file.csv
│   │   └── index.html
├── index.html
├── topic1
│   ├── custom_data_file.csv
│   └── index.html

My custom_data_file.csv file was copied on both languages and I can link to it in my .pages but now it's not working anymore... I understand it's more efficient this way but is there a way to achieve that anyway ?

@ultrabug
Copy link
Owner

ultrabug commented Feb 27, 2024

Bonjour Benoit,

I'm surprised by what you're experiencing since you say your tree structure would build as

site
├── fr
│   ├── index.html
│   ├── topic1
│   │   ├── custom_data_file.csv
│   │   └── index.html
├── index.html
├── topic1
│   └── index.html

but in my understanding it should build as

site
├── fr
│   ├── index.html
│   └── topic1
│       └── index.html
├── index.html
└── topic1
    ├── custom_data_file.csv
    └── index.html

Unless your mkdocs.yml says differently? Could you share it?

@brospars
Copy link
Author

Hello,
Yes my bad I modified it to simplify and made a mistake.

But another related problem is that sometimes images are inserted using html like so :

<figure>
  <img src="Images/TitreActivite.png" alt="Image alt" />
  <figcaption>Image caption</figcaption>
</figure>

with the following structure :

docs_dir
├── index.fr.md
├── index.en.md
├── Images
│   └── TitreActivite.png
site
├── fr
│   ├── index.html
├── index.html
└── Images
    └── TitreActivite.png

So images will work in the default language but not in the others...

@kamilkrzyskow
Copy link
Contributor

Try using the markdown in html extension and use it like the example here:
https://squidfunk.github.io/mkdocs-material/reference/images/#image-captions

If you have to use HTML tags then use absolute paths starting with a / or /prefix from your site_url if you're hosting the page on GitHub Pages.

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

No branches or pull requests

3 participants