-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Add excludePaths
option to frontmatter.content.pageFolders
config entries to allow filtering out subdirectories and filepaths based on regex matches
#840
Comments
@polynook, thanks for the suggestion. It is available in the beta for testing. It is implemented like the example above. Let me know what you think. |
@estruyf Thank you for working on this! I can't seem to get it to work though. I get Inspecting https://beta.frontmatter.codes/frontmatter.schema.json appears to be missing the Here is how I use it: "frontMatter.content.pageFolders": [
{
"title": "Page",
"contentTypes": ["Page"],
"path": "[[workspace]]/.frontmatter/content/page",
"previewPath": "/",
"excludePaths": ["generated/*"]
},
], The files that should be excluded reside in I'm using Front Matter |
You can ignore this, as the schema only updates when the documentation site has updates. As it needs to be verified, I haven't done this yet, so you get that. Once it's all working, I update the docs and the schema as well. I added a small fix for the Windows file system support. I believe this should fix your issue. |
I'm running on WSL and the issue for me was using an incorrect glob pattern (
Gotcha. Not sure if you've updated the docs already, but I just wanted to let you know that the schema says "excludePaths": {
"type": "boolean",
"default": false,
"description": "Exclude paths (e.g. api, _*.*)"
}, should be "excludePaths": {
"type": "array",
"default": [],
"description": "Exclude paths (e.g. api, _*.*)"
}, Please ignore if this is related to the documentation site not having been updated yet. Everything else works great, thank you! |
That type was indeed incorrect, updated it. |
Is your feature request related to a problem? Please describe.
As of now,
frontmatter.content.pageFolders
config allowsexcludeSubdir
which is a boolean flag. This is too restrictive to certain workflows.For example:
We have a
docs
content folder defined that contains documentation pages. The/.frontmatter/docs/
directory contains handwritten doc files, but there is a subdirectory/.frontmatter/docs/api
that has generated pages. These generated pages are not meant to be edited by hand, but they still appear in the CMS dashboard, slowing it down (when the number of pages is in the thousands) and need to be constantly filtered out in the dashboard.Describe the solution you'd like
Add an
excludePaths
option to content definitions infrontmatter.content.pageFolders
that would be a list of glob patterns and/or regex patterns to match against:excludePaths
option would resolve paths relative to thepath
option of this config. It should support matching against both directories and filepaths for maximum flexibility, since we may not want to exclude select paths.Supporting glob patterns is nice for ease of use and regex patterns is nice for more complex cases and flexibility.
Describe alternatives you've considered
Haven't come up with any viable alternatives.
The text was updated successfully, but these errors were encountered: