Skip to content
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

Issue: Stripping underscore in default filename #914

Open
lamyseba opened this issue Jan 25, 2025 · 2 comments
Open

Issue: Stripping underscore in default filename #914

lamyseba opened this issue Jan 25, 2025 · 2 comments
Labels
bug Something isn't working In BETA The current task is available for testing in the BETA version. v10.8.0 Project: v10.8.0

Comments

@lamyseba
Copy link

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]
@lamyseba lamyseba added the bug Something isn't working label Jan 25, 2025
@estruyf estruyf moved this to In progress in v10.8.0 Feb 6, 2025
@estruyf estruyf added this to v10.8.0 Feb 6, 2025
@project-labels project-labels bot added v10.8.0 Project: v10.8.0 In progress This is actively being worked on labels Feb 6, 2025
@estruyf
Copy link
Owner

estruyf commented Feb 6, 2025

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

@estruyf estruyf moved this from In progress to In beta in v10.8.0 Feb 6, 2025
@project-labels project-labels bot added In BETA The current task is available for testing in the BETA version. and removed In progress This is actively being worked on labels Feb 6, 2025
@lamyseba
Copy link
Author

Thank you @estruyf. beta version works for me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working In BETA The current task is available for testing in the BETA version. v10.8.0 Project: v10.8.0
Projects
None yet
Development

No branches or pull requests

2 participants