This project build a static website using mkdocs from your obsidian vault. Please note that this project adds YAML frontmatter to the notes in your existing vault for manging permissions and providing each note a UUID. If you don't like looking at frontmatter yaml in Obsidian you can install hua03/obsidian-toggle-meta-yaml-plugin from the community plugins page, though this functionality is now built into obsidian by default now.
- Linux Shell
- Obsidian Vault with notes you want to share
- nodejs + npm
- python3 + pip3
- Folder of markdown files you want as a HTML website
git clone https://github.com/dentropy/obsidian-publisher.git
cd obsidian-publisher
# Configure your Obsidian Root Folder
cp .env.example .env
vim .env
npm install
bash ./build.sh
cd obsidian-publisher
source .env
cd $build_path
# May Require `sudo apt install python3.10-venv`
python3 -m venv env
source env/bin/activate
python3 -m pip install mkdocs
python3 -m pip install mkdocs-material
python3 -m pip install mkdocs-backlinks
python3 -m pip install material-plausible-plugin
# pip3 install git+https://github.com/danodic-dev/mkdocs-backlinks.git
# pip3 install mkdocs-tooltipster-links-plugin
# pip3 install mkdocs-preview-links-plugin
python3 -m mkdocs build -vcd dentropys-obsidian-publisher
mkdir pkm
# Move your obsidian vault files you want in this folder
node process_markdown.js
cd site
mkdocs build -v
mkdocs serve -v
Check out Quickstart for GitHub Pages to setup github pages repository
Remember our static site is located at /site/site if you want to change things up
RUN ONE LINE AT A TIME
Create github repo with name $YOUR_GITHUB_USERNAME.github.io.git
# YOUR_GITHUB_USERNAME=dentropy
cd dentropys-obsidian-publisher
git config --global init.defaultBranch main
git clone git@github.com:$YOUR_GITHUB_USERNAME/$YOUR_GITHUB_USERNAME.github.io.gitEdit mkdocs-bak.yml
Replace the dentropy in site_url: https://dentropy.github.io to your github username
site_url: https://dentropy.github.ioChange pattern to the path where your Obsidian Vault is, remember to keep the /**/*.md at the end
Change offset_index to what the sliced index is, in this case Root is the main folder
Change out_path to $YOUR_GITHUB_USERNAME.github.io
Run raw_to_sqlite.js
source env/bin/python
cd dentropys-obsidian-publisher
rm test_vault/pkm.sqlite
rm -rf test_site
node raw_to_sqlite.js -i './test_vault' -o './test_site'
cd test_site
python3 -m mkdocs build -v
cd docs
python3 -m http.servercd dentropys-obsidian-publisher
node process_markdown.jsWhen process_markdown.js runs successfully your terminal should say Built Markdown Completed Successfully
Build site
cd dentropys-obsidian-publisher
cd $YOUR_GITHUB_USERNAME.github.io.git
git add .
git commit -m "Updated Site"
mkdocs build -v
cd docs
python3 -m http.server
# Go to http://localhost:8000 in your browser to test your site
# Ctrl + C to exit after verified site
cd ..
git add .
git commit -m "Rebuilt site"
git push origin mainFinish Configuring Github Pages
- Go to the git repository on on the github website
- Select
settingsalong the top navigation bar of the repo - Select
Pageson the left navigation bar undercode and automation- Under
SourceselectDeploy from a branch - Under
Branchselectmain - Select
/(Root)drop down and select/docs - Under
BranchselectSave
- Under
Wait 10 minutes and check site
Go to https://$YOUR_GITHUB_USERNAME.github.io cause your site should be up now
Note: The docker build is not as fully functionally as the CLI, for example you can not build you entire PKM, I chose this intentionally for security reasons
cp example_dot_env .env
$EDITOR .env
bash container-build.sh
bash container-run.sh
sudo chown $USER:$USER ./pkm_outgit add index.md markdown_files mkdocs* site_data*
git commit -m "Updated Site"
git add .
git commit -m "Rebuilt site"
git push origin main
See Plausible Analytics for Material
Yaml already has what is required, just update it
clear & node raw_to_nostr.js \
-i $("pwd")'/test_vault' \
-nsec nsec1qefu40tww6hsv362au9khlap9vt0jvrvtwu4rj2g82khvfc3uk0s2nxfdw \
-burl https://blossom.mememaps.net \
-be true \
-ds test001 \
-rl wss://t.mememap.net \
-dp index
node raw_to_nostr.js -i "$HOME/Documents/Root" -nsec nsec1l7sllh4ja808yc5ej77zgu0l2ryv62uzvu2cfsc60tuwamc9zktqc5h000
time node raw_to_nostr.js -i "$HOME/Documents/Root"