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

Img tags with relative paths have odd behavior #2816

Open
fulalas opened this issue Mar 7, 2025 · 2 comments
Open

Img tags with relative paths have odd behavior #2816

fulalas opened this issue Mar 7, 2025 · 2 comments
Labels

Comments

@fulalas
Copy link

fulalas commented Mar 7, 2025

Bug Report

My markdown project has a given folder with some .md files and a subfolder images with some images. I want to be able to see the images in both my markdown editors (MarkText or VsCode) and in the browser running ../zola serve.

Using <img src="images/test.png"> works in my markdown editors, however in the browser it doesn't load because the path has my current folder duplicated. For instance, my folder structure: docs/introduction/introduction.md and docs/introduction/images/test.png. When opening in the browser using zola the image path is pointing to docs/introduction/introduction/images/test.png which doesn't exist (note 'introduction' duplicated in the path), so the image doesn't load. If I edit the <img> src to add ../ in the beginning it works, however the markdown editors fail to load the image.

Environment

Zola version: 0.20.0

Expected Behavior

I expect the image path in the browser to not duplicate my current folder.

System

I'm running zola on PorteuX 1.9 x64 (Linux)

@Keats Keats added the bug label Mar 10, 2025
@fulalas
Copy link
Author

fulalas commented Mar 12, 2025

Investigating this a bit further, I noticed that when using multilanguage, Zola creates the language folder in the beginning of the path (e.g. for Spanish http://127.0.0.1:1111/es/docs/introduction/), which breaks the possibility of using images with relative paths.

Or maybe there's a configuration thing I'm missing.

@Keats
Copy link
Collaborator

Keats commented Mar 14, 2025

There's no flag to change the multilanguage URL setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants