Skip to content

Allow specifying the base URL for the generated files #184

@dkarlovi

Description

@dkarlovi

Is your feature request related to a problem? Please describe.

Some tools provide a way to generate a site for a specific base URL, for example Hugo supports setting a baseURL. This allows generating for multiple targets, generating for a subdirectory, etc.

Example:

BASE_URL=https://example.com/some/path ./my-generator --out=./public

Generates files which might have (some) of the URLs be absolute, for example https://example.com/some/path/images/logo.svg

Describe the solution you'd like

At this point, all URLs which start with https://example.com/some/path should be treated as local URLs and tried to be resolved using the filesystem, for example:

https://example.com/some/path/images/logo.svg => ./public/images/logo.svg
/some/path/images/logo.svg => ./public/images/logo.svg

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions