obsidian-digital-garden icon indicating copy to clipboard operation
obsidian-digital-garden copied to clipboard

Hide headers with no content

Open julesvirallinen opened this issue 1 year ago • 2 comments

If a folder has all items as hidden, the folder will appear in the tree as empty

CleanShot 2023-10-02 at 16 33 35@2x

julesvirallinen avatar Oct 02 '23 13:10 julesvirallinen

First things first: The code/repo relevant to this is actually over at https://github.com/oleeskild/digitalgarden
Pretty sure that is the location for the relevant code and working through if this is a bug or expected behavior. Recommend considering closing this issue here and re-opening it there.

However, before you do that, make sure you've updated your website template following these steps: https://dg-docs.ole.dev/getting-started/06-updating-the-template/

However, I can confirm this behavior is still happening in latest version of the template, although I'm not sure if this is a bug.

My vault that I have configured with a digital garden has many folders with items not included in the garden and I do not get any empty folders in the garden.

just played around setting dg-publish: true, publishing, then back to dg-publish: false, publishing the delete, in a deep folder that previously had not shown up on the garden website to see if that would trigger this effect. It did not.

Then I took one of those deep folders added a published note with dg-publish: true and dg-hide: true set on just one file. This created the effect you are talking about.

My personal reaction to this is to create some sort of index note that you don't hide that acts as a public listing in the file tree. There is published content available just not showing up in the side bar. Seems reasonable if you have published notes in the structure that the file tree stays consistent.

However, if more logic is wanted to avoid this behavior then there are two places to start looking:

  • digitalgarden/_includes/components/filetree.njk around line 52. That is one location you might be able to to determine if the folder is empty before passing it on.
  • And/or the building of the filetree object being used there which happens in: https://github.com/oleeskild/digitalgarden/blob/479ab3c545761994c15953bad5e0658c5ca950a5/src/helpers/filetreeUtils.js

Recommend closing up this issue and re-opening it over in the repo with relevant code: https://github.com/oleeskild/digitalgarden

dayne avatar Oct 06 '23 16:10 dayne

Yeah, I think the best would be switching to monorepo and moving all issues here, as users generally open all issues here anyway (and I think most issues for the template also are affected by the plugin side here).

If we don't feel this is an issue we can close this though. (if it's expected behaviour)

julesvirallinen avatar Oct 09 '23 09:10 julesvirallinen