Enhancement: Exclude content from subfolders? #137

Closed
opened 2026-10-05 02:27:23 +02:00 by adam · 3 comments
Owner

Add the option to exclude sub-directories.

@iveptawebadmin Thanks for opening the discussion. Let us follow it up here as this will become an enhancement to the CMS.

Discussed in https://github.com/estruyf/vscode-front-matter/discussions/172

Originally posted by iveptawebadmin November 9, 2021
On my Hugo site, many of my pages like about.md, contact.md, etc. are in the root of my content directory.
Then I have subdirectories for subsections of the site like blog, events, etc. that have pages within them.

I would like the root content pages to be shown in a 'Pages' section, and then news posts to be in a 'News' section and so on.
Is there a way to set this up so that the 'Pages' folder does not look into any of the subdirectories within the content directory?

"frontMatter.content.pageFolders": [
    {
      "title": "Pages",
      "path": "[[workspace]]/content"
    },
    {
      "title": "News",
      "path": "[[workspace]]/content/news"
    }
  ],

Right now the 'Pages' folder has all the files from every subdirectory within content.

Add the option to exclude sub-directories. @iveptawebadmin Thanks for opening the discussion. Let us follow it up here as this will become an enhancement to the CMS. ### Discussed in https://github.com/estruyf/vscode-front-matter/discussions/172 <div type='discussions-op-text'> <sup>Originally posted by **iveptawebadmin** November 9, 2021</sup> On my Hugo site, many of my pages like `about.md`, `contact.md`, etc. are in the root of my `content` directory. Then I have subdirectories for subsections of the site like `blog`, `events`, etc. that have pages within them. I would like the root content pages to be shown in a 'Pages' section, and then news posts to be in a 'News' section and so on. Is there a way to set this up so that the 'Pages' folder does not look into any of the subdirectories within the `content` directory? ``` "frontMatter.content.pageFolders": [ { "title": "Pages", "path": "[[workspace]]/content" }, { "title": "News", "path": "[[workspace]]/content/news" } ], ``` Right now the 'Pages' folder has all the files from every subdirectory within `content`.</div> <!-- github-sync-id:1049636595 -->
adam closed this issue 2026-10-05 02:27:23 +02:00
Author
Owner

@iveptawebadmin thanks for asking this. You will be able with version 5.5.0 of the extension to specify an extra excludeSubdir property for the pages folder.

"frontMatter.content.pageFolders": [
    {
      "title": "Pages",
      "path": "[[workspace]]/content",
      "excludeSubdir": true
    },
    {
      "title": "News",
      "path": "[[workspace]]/content/news"
    }
  ],

You'll be able to test it out with the latest beta version: https://frontmatter.codes/docs/getting-started#beta-version

@iveptawebadmin thanks for asking this. You will be able with version `5.5.0` of the extension to specify an extra `excludeSubdir` property for the `pages` folder. ``` "frontMatter.content.pageFolders": [ { "title": "Pages", "path": "[[workspace]]/content", "excludeSubdir": true }, { "title": "News", "path": "[[workspace]]/content/news" } ], ``` You'll be able to test it out with the latest beta version: https://frontmatter.codes/docs/getting-started#beta-version <!-- github-comment-id:965016952 -->
Author
Owner

Are you automatically pushing out updates to Open VSX on these updates to 'Beta'?

Are you automatically pushing out updates to Open VSX on these updates to 'Beta'? <!-- github-comment-id:966673033 -->
Author
Owner

@iveptawebadmin yes. It is part of the same release flow. If a main (with the upcoming version) or beta version is released, it gets published to both.

@iveptawebadmin yes. It is part of the same release flow. If a main (with the upcoming version) or beta version is released, it gets published to both. <!-- github-comment-id:966891909 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#137