Warning

I no longer use this system. It has been extended as described in Merging Public and Private Notes - Three Lines of Defence in Quartz 4.

Available options

Quartz offers three options for page filtering when generating a site from Obsidian.

  1. No filtering at all—every page is published
  2. RemoveDrafts—the default configuration removes all pages where publish: deny
  3. ExplicitPublish—exclude all pages unless publish: allow

This refers to Markdown pages only. Regardless of the filter plugin used, all non-markdown files will be emitted and available publicly in the final build. This includes files such as images, voice recordings, PDFs, etc.1

In my Obsidian folder I have two similarly named folders and I’m often moving files to them, or between them. They are:

  • Public, specifically in this case Public\notes
    • Everything in this folder I’m happy to share
  • Atlas, specifically in this case Atlas\Atlas - Notes
    • Nothing in this folder should every be shared on the website

The risk is muscle-memory fails me and I inadvertently put a private note into Public and it goes out. This is what will happen with options 1 and 2 above. Not the best idea. I’ve already taken steps to ensure my notes are not synced to the Github page for the site and this is another protective steps.

From today, a Markdown note will only be published if it is in the Publish folder AND publish: allow.

Always opt-in

Can we get to a world where opt-in is the default and not opt-out? In my view ExplicitPublish should be the default.

Supporting scripts

I’ve created a few Obsidian Templater plugin templates to help me set the flag.

Publish single note

This simple templater script sets publish: allow for the current note.

Unpublish single note

This simple templater script sets `publish: deny for the current note.

Publish all notes in folder

This script sets publish:true for all Markdown files in the named folder and below (case-sensitive). It can be used to ensure no files are missed.

Unpublish all notes in folder

This script sets publish:false for all Markdown files in the named folder and below (case-sensitive). It can be used to ensure no files are missed.

Footnotes

  1. Private Pages