Skip to content

Img tags with relative paths have odd behavior #2816

@fulalas

Description

@fulalas

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions