4-Add Code to Hide Folders and Files

Note: if the following steps work as expected, then the information in Explanation should work.

  1. If not already done, clone the Digital Garden repo created in 1-Setting up Vault and Repo to a place were code can be edited. Or create a codespace for it to edit the code.
    1. Pull main if cloning has already been done.
  2. Edit src/helpers/filetreeUtils.js. Replaces the lines for getPermalinkMeta and assignNested with the lines shown in this code snippet.
    1. This adds the isHiddenInTree attribute to the file/folder objects.
  3. Edit src/site/_includes/components/filetree.njk. Replaces the lines for menuItem with the lines shown in this code snippet.
    1. This filters out any items with the isHiddenInTree attribute set to true when building the file tree.
  4. Commit and push these changes.
© 2025 Bradley Don Morris | v1.2