See the public part of my note on https://note.pablolion.com/.
You don't have to download all this git.
deploy-obsidian.zsh
in the root folder does all the job.
This is a one-file repo.
- zsh
- obsidian-export from zoni/obsidian-export
- mkdocs from mkdocs.org
- netlify-cli from netlify.com then setup CLI with your netlify account.
- theme mkdocs-material
- two-space indentation mdx_truly_sane_lists
To install all of them with python pip and yarn (or npm), use this.
pip3 install mkdocs mkdocs-material mdx_truly_sane_lists
# npm install netlify-cli -g
yarn global add netlify-cli
-
Export these variables below in the .zshrc file or declare them in the
deploy-obsidian.zsh
fileobsidian_mkdocs_root=?????? # root of mkdocs project contains the mkdocs.yml file obsidian_vault=?????? # root of the obsidian vault, contains the .obsidian folder reserved_folder_name=?????? # name of the folder that contains static non-exported resources, this folder in $obsidian_vault/docs won't be deleted by the script. This variable is default to `res`
-
Make sure that your mkdocs store markdown files in the
docs
folder, and the all static resources inres
folder. -
!! All files except
$reserved_folder_name
(res
by default) in$obsidian_mkdocs_root/docs
will be removed!! -
Run
deploy-obsidian.zsh
, add it to your.zshrc
file, etc. (If you don't have a netlify-cli, please answer "NO" to the first question.) -
Enjoy.
-
(Optional) Write some feedback in this repo.
Q: Does it have the graph? A: No, it doesn't.
read -q invalid
: execute with zsh instead of with sh
- You can fix the GitHub flavor link with regex substitution/[[(.+)|(.+)]]/g => [[$2|$1]] (See it in my note)
- Discarded after 2 hours, because I find a easier way.