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

Reimplement base URL support without <base> tag #93

Merged
merged 6 commits into from
May 13, 2020

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Apr 24, 2020

This PR seeks to reimplement base URL support added in #65 based on feedback from #82. With my sincere apologies to @kean for leading him down the wrong path by advocating for <base> without being aware of its limitations.

I fully acknowledge the jankiness of this approach. Tacking on parameters all over the place like this is unsustainable, but I want to get a fix out sooner rather than later. Long-term, this is the kind of configuration I'd like to encapsulate by a Generator (#67)

@kean
Copy link
Contributor

kean commented Apr 27, 2020

Hey, @mattt. Thanks for addressing this. I was going to work on it, but I've been sick for the past two weeks.

@kean
Copy link
Contributor

kean commented Apr 27, 2020

@mattt , CSS also needs to use base-url. Currently it is not working when deployed in non-root folder.

<link rel="stylesheet" type="text/css" href="/all.css" media="all" />

@kean
Copy link
Contributor

kean commented Apr 27, 2020

Hmm, it seems swift-doc also used --base-url as an output path which was unexpected and I had to fix manually.

Screen Shot 2020-04-27 at 18 02 58

@kean
Copy link
Contributor

kean commented Apr 27, 2020

Ah, I see, the expectation is to put a single all.css in my root directory? I could do that, but I'm not sure how well it's going to work with my personal workflow. I deploy documentation once per version and then never touch it again. This isn't going to work if all.css file keeps changing with potentially breaking changes to the previously generated documentation.

@mattt
Copy link
Contributor Author

mattt commented Apr 28, 2020

Hmm, it seems swift-doc also used --base-url as an output path which was unexpected and I had to fix manually.

That's definitely a bug. Thanks for pointing that out.

Ah, I see, the expectation is to put a single all.css in my root directory? I could do that, but I'm not sure how well it's going to work with my personal workflow. I deploy documentation once per version and then never touch it again. This isn't going to work if all.css file keeps changing with potentially breaking changes to the previously generated documentation.

The idea is for swift doc generate to create a "bundle", such that everything within that bundle is sealed and self-sufficient. There may be changes in the DOM or CSS between releases that change appearance, but any generated output will be inert and unaffected by any such changes.

@mattt mattt marked this pull request as draft April 28, 2020 14:28
@mattt mattt added the enhancement New feature or request label Apr 30, 2020
@mattt mattt mentioned this pull request May 8, 2020
@mattt mattt marked this pull request as ready for review May 11, 2020 18:55
Copy link
Contributor

@kaishin kaishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had the chance to try it locally yet, but the rest looks good. 👍

@mattt mattt merged commit f49b9d7 into master May 13, 2020
@mattt mattt deleted the base-url-reimplementation branch May 13, 2020 15:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants