Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Fix link to CSS in default HTML output #96

Closed
wants to merge 1 commit into from
Closed

Fix link to CSS in default HTML output #96

wants to merge 1 commit into from

Conversation

captainbarbosa
Copy link

This ensures all.css is visible by the HTML file before the base URL is set, and fixes #95.

This was the most minimal change I could think of to get this to work, but another option could be to change the default base-url argument from "/" to just an empty string "" - let me know if that is preferred and I can make that change.

@mattt
Copy link
Contributor

mattt commented Apr 28, 2020

Thanks for looking into this, @captainbarbosa! We're actually in the process of switching away from <base> (#93), so that's probably going to be the long-term fix. Since you have fresh eyes on the situation, do you see any compelling reasons to stick with <base> or have any thoughts about the best alternative approach?

@captainbarbosa
Copy link
Author

captainbarbosa commented Apr 28, 2020

Oh, I didn't notice that. #93 looks like a better solution. I can close my PR in favor of a more long-term solution.

I'm not a regular web developer, but one additional thing I noticed is by setting <base>, sub-pages don't reference all.css relative to the rest of the project. So for example, the Docs/Index.html can find the CSS file, but Docs/MyClass/Index.html tries to reference all.css and not ../all.css. This issue occurs after applying #95. I think this is already captured in #93 (comment) so I won't open an issue.

I looked at Jazzy, a similar project, to see if they used <base> tags - it doesn't look like they do. I believe the equivalent config setting for that project is --root-url. It appears they are appending as many ../ that are needed to build out the links for each page, so this might be something to keep in mind when addressing #93.

#93 is likely a better solution than this PR, so I'll close this in favor 👍

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

Successfully merging this pull request may close these issues.

CSS doesn't link when generating default HTML format
2 participants