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

Allow specifying the base URL for the generated files #184

Open
dkarlovi opened this issue Jan 18, 2022 · 2 comments · May be fixed by #215
Open

Allow specifying the base URL for the generated files #184

dkarlovi opened this issue Jan 18, 2022 · 2 comments · May be fixed by #215
Labels

Comments

@dkarlovi
Copy link

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
@shishkin
Copy link

And some will be generated as relative, e.g. /some/path/main.css. Those currently are not resolved relatively to the root directory.

@francescocaponio
Copy link

On this same topic, it would be nice to have the same feature swap-urls of html-proofer, where your can replace a relative path with a base path to a relative path starting from the root, for instance /subgroup/repo-name/ to /.
This is needed when publishing to gitlab pages, where your path starts with /subgroup/repo-name/, but htmltest would raise error with such path.

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

Successfully merging a pull request may close this issue.

3 participants