GitHub Action that publishes Obsidian vault in MkDocs format, when pushed to the GitHub repository to Netlify.
- This action parses the the Obsidian vault markdown (.md file) to the markdown format supported by MkDocs, compresses all the images and publishes the website to Netlify.
- This action is triggered by a push to the
publish
branch.
name: Publish Vault
on: [push]
jobs:
Publish-Obsidian-Vault:
runs-on: ubuntu-latest
steps:
- name: Publish Vault
uses: project-cool/obsidian-publish-action@main
with:
websiteId: "<your-netlify-website-id>" # required
log_level: "info"
token: ${{ secrets.NETLIFY_TOKEN }} # required
branch: "publish"
image_resolution: 1920
compression_factor: 20
suppress_mkdocs_logs: true
The unrequired fields have the default values written above.
- Create a new repository to which the Obsidian vault will be pushed.
- The root folder should contain
.github/workflows/publish-obsidian-vault.yml
andmkdocs.yml
- Create a github secret which will store your Netlify access token.
- You can have the following directory structure
obsidian-vault
└─── .github
│ └─── workflows
│ │ publish-obsidian-vault.yml
│
└─── mkdocs.yml
│
│─── .git
│
│─── notes
│ │ blog.md
│ └─── engineering
│ │ scientist.md
│ │ ceo.md
│ │ mba.md
- Supported frontmatter format
---
updated: 2022-06-03
hidden: true
---
- If
hidden
is not mentioned, it is considered asfalse
(by default, all the MD pages will be published online). Ifhidden: true
, the corresponding MD file will be ignored. updated
is accepted as either2022-06-03
or2022-06-03T20:00:48+05:30
. This can by generated automatically for all the pages in Obsidian by using Update time on edit plugin.
Sample mkdocs.yml
site_name: Your Notes
theme:
name: material
features:
- navigation.tabs
- navigation.top
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/lightbulb
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: teal
accent: teal
toggle:
icon: material/lightbulb-outline
name: Switch to light mode
markdown_extensions:
- meta
- toc:
permalink: true
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- admonition
- pymdownx.details
- pymdownx.superfences
extra:
homepage: https://your-website.org
social:
- icon: fontawesome/brands/linkedin
link: https://www.twitter.com
- icon: fontawesome/brands/youtube
link: https://www.twitter.com
- icon: fontawesome/brands/instagram
link: https://www.twitter.com
copyright: Copyright © 2022 Your name