Some notes on my experience with setting up https://notes.wgslr.com using Quartz, the steps needed to set it up and plans/wishes for the future.
Pros and cons
Some thoughts on what’s nice, what’s missing and what I might want to fix. That’s in comparison to alternative solutions for maintaining a personal blog, such as building it with Next.js are setting up WordPress.
The pros:
- using the Obsidian flavor of markdown with wikilinks - I already maintain a private wiki using Obsidian, so it’s nice to think that I can just add some polish to my notes and they are ready for publishing.
- batteries included: Quartz generates an RSS feed, a sitemap, and the cool-but-useless graph on the right
- cheap: static sites are easy to host for free. This one lives on Vercel
The cons:
- breaking old URLs: if I move a note, its URL will change and old links I’ve shared will stop working. A full-fledged CMS like Wordpress would solve this by tracking old names and redirecting. With Quartz, I need to be careful to leave notes in their original places.
- no server-side code: Quartz is a static site generator, as opposed to frameworks like Next.js which allow mixing static and dynamic content. This limits my possibilities in adding interactive elements to the notes.
The wishlist / todo:
-
track old names of notes and generate redirect pages. I’ve realized there is already support for redirects from the aliases defined in the frontmatter, so I just need:
- a script to record path history automatically
- extend the redirects functionality to handle full paths, in case the note was moved between folders
-
Do not create
<a>tags for links to missing pagesQuartz does not check which wikilinks lead to an existing page. In my private wiki, I often create links to pages which not exist yet. Including them in the published note leads to the bad user experience of hitting a 404 page. When processing the source files, it should be possible to check whether the target exists and mark the dead link differently (or render it as plain text).
DONE I added a hacky check to link resolution. Unfortunately does not respect the filtered out files (not marked for publication), for those links are still generated.
-
there is a WIP PR in quartz (https://github.com/jackyzha0/quartz/pull/866) to have per-directory RSS feeds. This supports my idea to have a directory in quartz double as a more professional “blog” with better articles.
Setup steps
Steps I’ve done so far in setting up this website
- Fork https://github.com/jackyzha0/quartz and clone locally
- Adjust
quartz.config.ts: change baseUrl, page title, addPlugin.ExplicitPublish()to filters, add git toPlugin.CreatedModifiedDateconfig. - Set up a Vercel project linked to the github repository
- Configure Vercel Analytics - this required modifications in
quartz/plugins/emitters/componentResources.tsto add the script tag - Switch Quartz imagery and links to my own
- Change footer links configuration in
quartz.layout.ts - Remove
<meta og:image>fromquartz/components/Head.tsx. This image is used for example as the preview when sharing links in instant messengers. Until I have a better replacement, I don’t want to use the default quartz banner. - Update quartz/static/logo.png with my custom favicon
- Change footer links configuration in
- Add scripts to
package.jsonto simplify pulling new content from my wiki, which is stored in a different directory - Modify
quartz/plugins/emitters/404.tsxto show the left sidebar with Search and Explorer even on the “404 Not Found” page