Summary:
I want to host (public) SB libraries on GitHub Pages.
This is currently not possible, because a GH Pages site for a repository always starts with a ‘subdirectory’ named after the repository (i.e. <username>.github.io/<repository>).
If the federation plug can normalize the URL for loading libraries, then it’s much easier and more secure (from a hosting point of view) to share themes and snippets!
A similar idea I’d like to see would be the ability to import libraries directly from a git repo (bypassing the federation plug).
Plugs can be downloaded using a github url or a github release url. Having a similar format for Libraries would make sense imo, and make it a lot easier for people to share their libraries with each other.
First test was successful, but the code still needs some tests, tidying up and better error handling.
Maybe also cleaning up the old library before pulling in the new one like the federation plug does.
Initially I called the plug github-libraries. But there could be other providers as well.
Either configurable from within the plug or by passing some extra info in the settings.
I can imagine that you could have plain http(s) downloads from the same domain/path or other services that serve the raw files from a different location (like GitHub does).
So then maybe the name ‘external-libraries’ makes more sense.
Adding the functionality as a plug actually works very well for my needs. So for now, I’m satisfied!
I’ve also just added the possibility to download from any https-resource. So Libraries in ‘spaces’ like https://janssen-io.github.io/silverbullet-libraries/Library/... can also be downloaded. The root of the ‘space’ (and thus the index.json location) is determined by the location of the Library directory.