Description
Is your feature request related to a problem? Please describe.
Refer Astro Content Loader API | Docs, astro use github-slugger to generate a slug with kebab-cased words.
Setting frontMatter.taxonomy.slugTemplate
has these options:
- When using the {{title}} placeholder in the slug template it will be automatically converted to lowercase and spaces will be replaced with hyphens.
- To have a SEO friendly URL, you can use the {{seoTitle}} placeholder instead.
- If the setting is not defined, the page name will be used as the slug.
I don't use slug
property in file, just let astro generate it by file name. But there is no an option to tell front matter CMS to use a slugged file name to open the preview.
It is not a big problem, since files created by front matter panel has a slugged file name. But when user create file manually, the file name may have space, causes preview path mismatch.
Describe the solution you'd like
New setting to set file name to slug strategy. Or new placeholder like {{fileName}}, {{sluggedFileName}} for frontMatter.taxonomy.slugTemplate
. Or match the slug strategy automatically with the framework setting