Open tothambrus11 opened 4 months ago
I think some other solutions would be:
TargetResolver.url(to:)
method when we want a URL to refer to a specific target. That way we would be able to modify this method to offset URLs with a base URL as suggested to allow for deploying the documentation to a subfolder. Right now this method is used mostly when referring to a target other than the current target when rendering a page.Exporter
with the base URL to the export path we could split the url
property of ResolvedTarget
into exportUrl
and targetUrl
or something similar where the refers to the actual file location relative to the export path and the URL on the website with the subfolder path respectively.The second option might make it more difficult to keep a proper separation of concerns and not to bloat the ResolvedTarget
/ resolution step.
Currently, the website generation assumes the project will be deployed to a domain's root. However, many people want to host their documentation in a subfolder, like https://example.com/docs, in which case all our absolute references would break, e.g.
src="/assets/style.css"
.There are multiple solutions:
background: url(../../../assets/icons/copy.svg
). This would be very convenient from the user side, as they wouldn't need to worry about setting base urls, they could even open up the website from their file browser without the need for a web server. It would only be possible to do after we have migrated away from Stencil, the html templating library that we are using, because if we need to regenerate the navigation side panel for all html files, it takes over 2 minutes to export documentation for the standard library.