Skip to content

[Feature]: Allow configuration of a base URL #43

@bbbonnibel

Description

@bbbonnibel

Is your feature request related to a problem?

I host my DocMD site at a github page. So let's imagine the docs are hosted at example.github.io/project/.

DocMD however generates at localhost:3000.

This breaks all the absolute paths I might use.

If I do the following: <img src="/assets/images/example.png">, then it works locally but breaks on deployment. I have to do a first pass like this, then replace it with <img src="/project/assets/images/example.png"> before release, at which point it will be broken locally. I have to consciously revert/unrevert if I want to work on that section further with assets loaded in.

Alternately, I have to use relative paths.

This also impacts markdown links between pages, where I have to choose between [relative](../another/page) or [absolute](/section/another/page, where the latter either works locally or on deployment but not both.

Describe the solution you'd like

If I could specify a base URL of "/project" in configuration, my absolute paths would work fine. DocMD should also aim to replicate that baseURL.

Describe alternatives you've considered

DocMD could also update URLs, but I suspect that won't be safe and might hit code blocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions