hikerpig / gatsby-project-kb

Developing gatsby-theme-kb, a Gatsby theme for publishing Knowledge Base.
https://gatsby-project-kb.vercel.app/
MIT License
61 stars 15 forks source link

Is there a way to make all files under a folder private? #49

Open andreiRS opened 2 years ago

andreiRS commented 2 years ago

I have a folder called ‘journal’ with lots of entries, each date as a standalone file. I would like to prevent this folder from being accessible, while still having it versioned by git.

Since making individual files format is already implemented, is there a way to make an entire folder private?

hikerpig commented 2 years ago

Currently, no. But I think maybe we can add a privateNotes glob config in the options to make it possible, though.

I'm curious about how Obsidian handles this?

andreiRS commented 2 years ago

Obsidian allows the user to define a list of excluded folders. https://help.obsidian.md/Obsidian+Sync/Select+files+and+settings+to+sync

You configure using this UI. (Behing settings are stored in a json file) CleanShot 2022-03-22 at 06 38 26@2x

Here is a video from Curtis McHale where he elaborates more the Obsidian Sync feature: https://www.youtube.com/watch?v=JHAhE8QNokw

hikerpig commented 2 years ago

Sadly I don't have an Obsidian account for the sync features, but I get the idea.

Basicly the config will be something like:

    {
      resolve: 'gatsby-theme-kb',
      options: {
        contentPath: path.resolve(__dirname, 'content'),
        ignore: ['.git', 'features', 'otherfolder/**/*'],
      }
    },

The config key ignore is already there but has not controlled the notes to publish now.

I'd like to implement it in the next version.

andreiRS commented 2 years ago

Sounds good!

andreiRS commented 2 years ago

I used the ignore config key for hiding the journals entries and it worked as expected. Don't know if it needs any enhancement or if there are side-effects that I am not aware of.

hikerpig commented 2 years ago

@andreiRS You can keep it. The enhancements will be internal.