You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Adding support for setting a base url in the CLI, and use html's meta base tag to define the base url. After that, all relative urls would be resolved from that base, probably also inside css files.
Outputting relative urls everywhere, that correctly reference the targets. This requires computing the relative urls from every html file to every target that is being referred to, and the css references would probably not work unless we generate the parts of the css inside the html that are referencing assets (e.g. 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.
The text was updated successfully, but these errors were encountered:
Always use the 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.
Rather than providing the 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.The text was updated successfully, but these errors were encountered: