4-Add Code to Hide Folders and Files
Note: if the following steps work as expected, then the information in Explanation should work.
- 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.
- Pull
main
if cloning has already been done.
- Pull
- Edit
src/helpers/filetreeUtils.js
. Replaces the lines forgetPermalinkMeta
andassignNested
with the lines shown in this code snippet.- This adds the
isHiddenInTree
attribute to the file/folder objects.
- This adds the
- Edit
src/site/_includes/components/filetree.njk
. Replaces the lines formenuItem
with the lines shown in this code snippet.- This filters out any items with the
isHiddenInTree
attribute set totrue
when building the file tree.
- This filters out any items with the
- Commit and push these changes.