Skip to content

Inconsistent link between MarkDown and HugoServer #14

@leemyongpakvn

Description

@leemyongpakvn

According to https://gohugo.io/content-management/urls/#pretty-urls, (since v0.12) Hugo's Pretty URL replace .md extension of source by a trailing slash / on target.
For example:
source https://github.com/PrestaShop/docs/blob/8.x/modules/concepts/hooks/use-hooks-on-modern-pages.md
becomes
target https://devdocs.prestashop-project.org/8/modules/concepts/hooks/use-hooks-on-modern-pages/
So if I have an image in the same folder of use-hooks-on-modern-pages.md file for example and use in .md source
like this ![Export XML action button](Catalog_Products_2xml.png), I can see the image in MarkDown preview.
But on Hugo target, the image link will become /Catalog_Products_2xml.png then disappears.
To solve this problem, we can use absolute path, or use ../Catalog_Products_2xml.png in .md source. It is really an annoyance because the absolute path is usually too long and not flexible, while ../ prefix make the image disappears in MarkDown preview.
I think we can try this solution truly portable Markdown links and images. It sounds great but I'm not familiar with Markdown Render Hooks 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions