Bridgetown Obsidian Plugin
A Bridgetown plugin to convert Obsidian notes to Bridgetown posts.
This plugin allows you to use Obsidian's internal links feature to cross reference your Bridgetown posts and embed images. It replaces all the wikilinks references in src/_posts with Bridgetown compatible versions:
- Converts wikilinks from
[[My Markdown Post]]to<a href="/my-markdown-post/">My Markdown Post</a> - Supports optional link titles such as
[[My Markdown Post|with an optional title]] - Converts image references from
![[attachments/image.jpg]]to<img src="/attachments/bridge.jpg" alt="" />
Installation
Run this command to add this plugin to your site's Gemfile:
bundle add bridgetown_obsidianThen add the initializer to your configuration in config/initializers.rb:
init :bridgetown_obsidianObsidian Setup
There are two main ways you can use this plugin with obsidian.
-
Create a new vault that points to your
src/_postsfolder in Bridgetown. In this case you might want to add.obsidianto your.gitignorefile. -
Create an symbolink link in your existing vault to your Bridgetown folder. This option is strongly advised against by Obsidian so use at your own risk.
ln -s /path/to/bridgetown/folder/src/_posts "My Blog"In either case, turn on Use [[Wikilinks]] option in Files & Links settings.
Usage
Edit your posts in Obsidian. If you have a Bridgetown server running, you can see your changes in real-time. If not, your changes will get reflected the next time you build your site.
Testing
- Run
bundle exec rake testto run the test suite.
Credits
Check out these other great plugins that helped to inspire this one:
- https://github.com/SpinalCMS/bridgetown-internal-markdown-links
- https://github.com/jamie/bridgetown-notable
Contributing
- Fork it (https://github.com/onurozer/bridgetown-obsidian)
- Clone the fork using
git cloneto your local development machine. - Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request