Issue: Stripping underscore in default filename #712

Closed
opened 2026-10-05 03:01:37 +02:00 by adam · 3 comments
Owner

Describe the bug
When describing a content type in your frontmatter.json, you can specify a default file name, that will be used when creating content of this type. If you set a name with an underscore _ , the underscore will get stripped out of the name (the content file name will not have this underscore). This is annoying when using vscode-frontmatter with Hugo site generator, because _index.md is a filename that means something else as index.md for Hugo

To Reproduce
in your frontmatter.json, in a content type description :

{
  [...]
  "frontMatter.framework.id": "hugo",
  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": true,
      "defaultFileName": "_index",
      [...]
    }
  ]
}

Create a new content => The file name will be index.md, not _index.md

Expected behavior
The underscore should not be stripped, or there should be an option that ensure it is not stripped (eg. "cleanDefaultFilename" : false)

Device:

  • OS: Linux
  • Front Matter CMS Version [10.7.0]
**Describe the bug** When describing a content type in your `frontmatter.json`, you can specify a _default file name_, that will be used when creating content of this type. If you set a name with an underscore `_` , the underscore will get stripped out of the name (the content file name will not have this underscore). This is annoying when using vscode-frontmatter with Hugo site generator, because `_index.md` is a filename that means something else as `index.md` for Hugo **To Reproduce** in your frontmatter.json, in a content type description : ```json { [...] "frontMatter.framework.id": "hugo", "frontMatter.taxonomy.contentTypes": [ { "name": "default", "pageBundle": true, "defaultFileName": "_index", [...] } ] } ``` Create a new content => The file name will be `index.md`, not `_index.md` **Expected behavior** The underscore should not be stripped, or there should be an option that ensure it is not stripped (eg. `"cleanDefaultFilename" : false`) **Device:** - OS: Linux - Front Matter CMS Version [10.7.0] <!-- github-sync-id:2810984131 -->
adam closed this issue 2026-10-05 03:01:37 +02:00
Author
Owner

Thank you, @lamyseba, for opening this issue. A fix has been implemented, and you can test it out in the latest beta version of the extension.

https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta

Thank you, @lamyseba, for opening this issue. A fix has been implemented, and you can test it out in the latest beta version of the extension. https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta <!-- github-comment-id:2639251696 -->
Author
Owner

Thank you @estruyf. beta version works for me !

Thank you @estruyf. beta version works for me ! <!-- github-comment-id:2657927631 -->
Author
Owner

Version 10.8.0 has been released

Version 10.8.0 has been released <!-- github-comment-id:2687640575 -->
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#712