obsidian2web
my obsidian publish knockoff that generates (largely static) websites
this idea came to be from using a notion page for a knowledge index and seeing absurdly poor performance come out of it. thought i'd make my own to get my fingers dirty in zig once again.
you see it in action here: https://l4.pm/vr/lifehax/
(note, do not name any folder inside your vault public/
, it will break links,
i learned this the hard way. one day i'll fix it.)
installation
- get a recent master build off https://ziglang.org/download/
- tested with
0.11.0-dev.1711+dc1f50e50
- tested with
- install libpcre in your system
- get zigmod
git clone https://github.com/lun-4/obsidian2web.git
cd obsidian2web
zigmod fetch
zig build
# for production / release deployments
zig build -Dtarget=x86_64-linux-musl -Dcpu=baseline -Doptimize=ReleaseSafe
usage
you create an .o2w file with the following text
vault /home/whatever/path/to/your/obsidian/vault
include ./directory1
include ./directory2
include ./Some article.md
other directives you might add
index ./path/to/some/article.md
to set the index page on your build- if not provided, a blank page is used
webroot /path/to/web/thing
to set the deployment location on the web- useful if you're deploying to a subfolder of your main domain
strict_links yes
orstrict_links no
(default isyes
)- either force all links to exist or let them fail silently (renders as
[[whatever]]
in the output html)
- either force all links to exist or let them fail silently (renders as
project_footer yes
orproject_footer no
(default isno
)- add a small reference to obsidian2web on all the page's footers.
custom_css path/to/css/file
- use a differentt file for
styles.css
instead of the builtin one
- use a differentt file for
build your vault like this
./zig-out/bin/obsidian2web path/to/build/file.o2w
and now you have a public/
in your current directory, ready for deploy!