Jack Cuthbert

Bearblog CSS and JS hosted by jsDelivr

It's become very cumbersome to edit my CSS and the modified JS for images galleries in the Bearblog editors now that they've grown to be quite large. Most advice I've found (so far) was to just copy/paste right into the header and footer directives, or the styling view in the theme settings. This works perfectly well but I want version control, and the comfort of my own editor with vim bindings. Turns out it's trivial to use jsDelivr to act as a CDN for my GitHub stuff, so why not use that?

Open up their GitHub converter tool, paste in your GitHub file URL (not the raw file, just the regular view). Then create your <script /> or @import url("") lines as needed.

For scripts, in "Settings" -> "Header and footer directives":

<script type="text/javascript" src="url-from-jsdelivr.js" />

For CSS styles, in "Edit theme CSS":

@import url("url-from-jsdelivr.css");

This does mean that caching is now a problem and updates aren't propagated as quickly so you might not want to use this until your theme and JS plugins stabilise a bit. To get around this you could also upload the JS/CSS files directly to Bearblog's media but this requires manual work to achieve unless you feel like reverse engineering their APIs or using something from the community (future Jack problem).

#development #software