Obsidian Publish: Hide folders from left nav without losing references

Things I have tried

  • Searching Obsidian Help
  • Searching Forum - found this which doesn’t seem to address my exact need link

What I’m trying to do

  • I have two Obsidian Vaults, one is used for my total PKM the other is used for Publishing my blog via Obsidian publish.
  • I sync select folders from my PKM Vault to my Publish Vault via ChronoSync app.
  • I’ve done it this way so that I can write freely in my PKM vault and publish only select folders to my Obsidian Publish blog. I know I could do this using the folder selection, but this extra level of separation gives me peace of mind knowing I won’t accidentally publish something personal / unpolished to my blog.
  • To ensure all my attachments (images in my case) and .MD files sync when I sync a folder, I have set the ‘attachments’ to be a sub-folder. Such that when I sync “Vault\Products” it moves all the “Vault\Products\text.md” and “Vault\Products\attachments”.
  • I’ve used this CSS modification to hide the folders that I don’t want showing up in my left nav (as they aren’t useful to those consuming my content).
[.tree-item-self[data-path^='Products/attachments'] {
    display: none;
  • However, when I do this it is preventing the attachment files (images in my case) from being shown in my .MD files.

How can I get around this so that I can have:

  • My attachments stored in their respective sub-folders for each parent folder (to enable sync).
  • My attachments folders hidden from left nav.
  • The images in my attachments folder still visible in my post


When I came back in to check on my vault, the images where showing using the approach above. So the solution above worked, I just needed my browser to catch up.

1 Like