Part of Obsidian guides
There are times I want to create a public link to one of my notes, without having an entire "digital garden" through Obsidian Publish.
Enter Obsidian Share. To share a page, just run a single Templater script. Templater is also optional - it's plain Javascript so you can launch it from anywhere.
This page you're currently reading was published through Obsidian Share.
Uploads using your current theme, along with all your options and custom CSS. I'm using Primary in this document.
Local and remote image support:
Supports anything that Obsidian Reading mode does, like rendered Dataview queries or any plugins that show content inside the normal Reading view.
Here's an example inline Dataview query. It will be correctly rendered when sharing:
The answer is `= 7 + 8`!
The answer is 15!
Supports callouts with full styling:
Contents may be epic
Filenames are anonymised through hashing so people can't discover your other shared notes.
If your shared note links to another note which is also shared, that link will also function on the shared webpage. Example: Some other document
Frontmatter is stripped on upload to avoid leaking unwanted data.
YAML_FIELD
- The frontmatter field prefix for storing share link and updated time. A value of share
will create frontmatter fields of share_link
and share_updated
.WIDTH
- The width of the note body, in pixels.SHOW_FOOTER
- Turn the "Published with Obsidian Share" footer on or off. You can also replace the footer text with anything you want.I use Templater solely because it's an easy way to launch a script. You don't actually need Templater for this to work, it's just plain Javascript.
<%*
// Paste the script contents here
%>
The first time a file is shared, the script will automatically upload all the theme styles. The next time you share the same file, it will ignore the CSS since it's already been uploaded. If you want to force the theme CSS to re-upload, just remove the share_link
property from your frontmatter.