← TIL
#obsidian#astro#automation

TIL: Obsidian vault folders can trigger blog sync without frontmatter flags

Instead of adding publish: true to every note, the sync script can treat specific folders as auto-publish zones.

How it works

const inBlogFolder = resolve(vaultFile).startsWith(VAULT_BLOG_DIR + '/');
const inTilFolder  = resolve(vaultFile).startsWith(VAULT_TIL_DIR  + '/');
const shouldPublish = fm.publish === true || ((inBlogFolder || inTilFolder) && fm.publish !== false);
  • Notes in til/ → auto-synced to blog til collection, no frontmatter needed
  • Notes in Blog/ → auto-synced to blog posts collection
  • publish: false still opts a note out explicitly
  • Collection is inferred from source folder when type is not set in frontmatter