description: The mechanism for publishing or sharing individual pages. tags: maturity/beta glossary references:
SilverBullet is aimed for single-user, private use. Nevertheless, many have the need to share some content kept in SilverBullet with the outside world: to push content out, pull it in, or even sync between different locations. This is where SilverBullet share functionality comes in.
Note: If you are interested in one-off ways to get content out, have a look at Export.
Sharing may be desirable in different directions:
SilverBullet has [^Library/Std/Infrastructure/Share|infrastructural support](^Library/Std/Infrastructure/Share|infrastructural support) to solve this problem in a general way. It leverages Frontmatter, specifically the following three keys:
share.uri: specifies the external location to push, pull or sync your content with, represented as a URI|URI.share.mode: specifies the mode this sharing should happen, options are: push, pull or syncshare.hash: automatically calculated and updated content hash of your local version to detect whether local changes were made since the last share operation.On the page you’re interested to share, run the ${widgets.commandButton "Share: Page"} (bound to Cmd-p/Ctrl-p by default) command. This will pop up a list of enabled “Share providers”. Pick one and follow the provider-specific setup steps. At the end, your page will be shared and the share.* frontmatter keys automatically set.
Subsequent shares can be done simply by running the Share: Page command again.
Out of the box, sharing is supported for:
https:// URIs (Pull mode only) (implemented in ^Library/Std/Infrastructure/URI).https://github.com/* for repository files and https://gist.github.com/* URLs): both in Pull mode, and Push mode when a token is configured. Technically Sync should work except that Github aggressively caches files, making this impractical.To implement your own share provider, have a look at the implementations linked to understand how they work.