This note holds general information regarding my workflow and they way I publish content in this website.
I cloned the quartz repository and placed the obsidian vault inside the content folder.
For most technical and general website configuration operations I use WebStorm. For content manipulation, I use obsidian. This system allows to me to only be in contact with local markdown files in an isolated environment 99% of the time, while making deployment easy.
To build and host the website locally, I use:
1npx quartz build --serve --port <port>
To build and push the website to GitHub, I use:
1npx quartz sync
I use the shell command plugin in order to run these commands straight from the obsidian editor. An interesting side effect of this is that command can be written as a markdown link. For example, here's a link to the build and push command as an obsidian URL Build & Push (this does nothing on the static website, so you'll have to believe me that it works).
Note that building with quartz actually temporarily deletes the content folder, so if you set it as the vault that will cause obsidian to crash. To overcome that you can set the vault in a folder above it. The location of the content is also customizable for both commands above using the -d flag.
I use waypoint to automatically generate & update tables of contents for all of my folders. Note: with the attachment management process described later, it is a good idea to blacklist folders with the name of the attachment folder (Attachments in my case) (Waypoint allows this with the "Ignored Files/Folders" option).
I decided to disable the default usage of WikiLinks in Obsidian, as it led to some link resolution problems with Quartz. This choice is also available in Waypoint. In addition, It’s what the markdown standard defines a link should look like, and it’s what’s supported on most apps, scripts and services. It’s also more future-proof.
It's useful to make git locally treat filenames as case-sensitive. This is due to the fact that changing a markdown file name updates links to it, but this change is not reflected in the new URL due to git not noticing the change. The command for this is:
1git config core.ignorecase false
I also use a git submodule further discussed in the following section.
It is more comfortable for me to have a single obsidian vault with a separate private note directory rather than having to mark each note as private individually. I also wished to back them up separately on a private git repository. The way obsidian vaults work, symlinks are apparently dangerous (untested claim), therefore I decided to add a git submodule inside the contents folder, which would be ignored by the main website repo.
When adding images to my notes I typically just copy and paste them. On default, obsidian just places the image file in the same folder as the note, with a non helpful name. Towards fixing this I use 2 plugins: Attachment Management Which allows attachment to be automatically renamed with some parameters, for example the date or the file name. Consistent Attachments and Links which allows moving attachments with files (and fixing wikilink paths) automatically. So for each folder where the notes inside have image attachments, there's a nested Attachments folder. When I paste an image into a note, it goes into <note path>/Attachments/<note name>.