buckleyresearchltd28 downloadsPublish markdown notes and images to a GitHub repo.
Publish markdown notes and images from Obsidian to GitHub repositories. The plugin supports content collections and handles image uploads automatically.
If you don't know what your doing, this probably isn't for you. I'd recommend using the Obsidian Digital Garden plugin instead. It does pretty much the same thing, however because I'd already built a site using Astro, making it work for my use case was harder than writing my own from scratch, but that plugin is basically this one but better.
The plugin publishes markdown files to a GitHub repository. It converts Obsidian wikilinks to standard markdown syntax. Images embedded in notes are uploaded to a specified assets directory. The plugin can organize content by post type in subdirectories or publish to a flat structure.
Files are published when the pb-publish frontmatter field is set to true. The pb-type field determines the content subdirectory. Both fields are required.
Images are tracked across all published notes. When unpublishing a note, images used only by that note are deleted. Images shared by other published notes are preserved.
Install BRAT, then add BuckleyResearchLtd/ObsidianGithubPublisher as a beta plugin. BRAT tracks new releases automatically.
Download main.js and manifest.json from the latest release and copy them to your vault's plugin directory at .obsidian/plugins/github-publisher/. Then reload Obsidian and enable the plugin.
The plugin requires a GitHub personal access token with repository write permissions. Configure the following settings:
main)src/content/)src/assets/)../../assets/)When enabled, files are published to {contentDir}/{postType}/{filename}. When disabled, files are published to {contentDir}/{filename}.
Add frontmatter to your note:
---
pb-publish: true
pb-type: blog
---
Run the command "Publish current page" from the command palette.
The plugin uploads the markdown file and any embedded images. It converts image wikilinks to relative paths. Frontmatter image references use plain paths. Content image references use markdown syntax.
Run the command "Unpublish current page" from the command palette.
The plugin deletes the markdown file from GitHub. It checks all other published notes for image usage. Images not used elsewhere are deleted. Shared images are preserved.
Images in frontmatter are supported:
---
cover: [[hero-image.png]]
---
The plugin converts these to paths:
---
cover: ../../assets/hero-image.png
---
The plugin uses the GitHub API through Octokit. All file operations are batched into single atomic commits. Image filenames are sanitized by replacing spaces with hyphens.
When publishing, the plugin:
When unpublishing, the plugin:
Install dependencies:
npm install
Build the plugin:
npm run build
Run in development mode:
npm run dev
Lint the code:
npm run lint
Run the tests:
npm test
0-BSD