twostraws / Ignite

A static site generator for Swift developers.
MIT License
1.71k stars 94 forks source link

Make Bootstrap files optional #107

Closed 0xTim closed 2 months ago

0xTim commented 2 months ago

Many sites may want control over the bootstrap files that are added, for example:

This PR introduces a new config option, useDefaultBootstrapURLS, that can be used to disable the default CSS and JS files for Bootstrap to provide better customisation.

0xTim commented 2 months ago

@mikaelacaron if/when this is merged you should pull this in and disable it to stop it conflicting with the CDN files

twostraws commented 2 months ago

I like this – thank you! I have a couple of thoughts:

  1. With this change it becomes possible to set that Boolean to false, then wonder why large parts of the output now fails – menu bars won't show, image carousels won't work, popover, most styling will be wrong, etc. I'm pretty sure almost every Ignite-generated site would look terrible and have significant functionality failures.
  2. If we go down this route, I have a feeling that switching the Boolean for an enum with cases .localBootstrap, .remoteBootstrap, and .none might work better, because I know other folks would like to see Tailwind or similar.

How does that sound?

0xTim commented 2 months ago

@twostraws yep sounds good! I've updated the PR

Note that I've also applied the same options for the Icon stuff, which should probably be a separate PR, but ties in. This would be a breaking change though, I don't know how much of a concern that is

twostraws commented 2 months ago

Thank you! I'll merge this in now. I'm still not fully sure of how to handle the resulting breakage if someone chooses to disable Bootstrap entirely, but I guess they are opting in to that behavior so at least it's not surprising! I'm not worried too much about API breakage while we're still in 0.x version numbers.