-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Entries with complex extensions do not appear in collection view #877
Comments
This is caused by our extension filtering function. When it gets the extensions from the file, it only gets the last extension, assuming everything before that is part of the filename. https://github.com/netlify/netlify-cms/blob/9c7c0aeed22cce1fbe01db48e239da49ba3b42ec/src/backends/github/implementation.js#L56 https://github.com/netlify/netlify-cms/blob/834c5f4942ee9f694a900a834c6f672d31761922/src/lib/pathHelper.js#L83-L91 |
Just to lend a bit of context... These multi-part extensions are a requirement of Middleman as of v4. Here's the issue where they discuss the motivation for this change: middleman/middleman#1211 |
We should support this. |
Same issue here. I'm deploying a multilingual host with HUGO which requires a complex extension. It'd be great to allow this. |
Yes, Hugo multilingual requires complex extensions, and it would be great if Netlify CMSΒ could be fixed to support them. For example, currently example.fr.md is changed toΒ example-fr.mdΒ - Hugo requires that the extension remains .fr.md |
We'll take a PR if anyone is up for digging in. |
Hi, I'm afraid my JS skills are fairly limited. However I see two solutions: |
Is dots in the filename something that people actually do? I'm not sure that that's a common enough practice to be something worth supporting. |
I'm not an expert and can be easily wrong in my view. |
I think a simple fix would be to simple check if the file ends with the extensions specified: files.filter(file => file.name.endsWith('.' + extension)) We would want to check it with a period prepended to the extension, so that we wouldn't accidently match part of the file name ( |
@kornichon2000 I agree that your last solution is probably not the best option -- we don't really want to introduce regressions here. How do you see implementing your option |
@tech4him1 Somewhere in the code there is a function that parses the name string to replace invalid url characters with dashes. However the dot . is a valid url character. I think the solution is to modify the parsing routine so it leaves dots unchanged in the filename. I can't think of a negative side effect. |
@kornichon2000 there were issues with static site generators or deployments or something that made us rule out periods. Plus slugs traditionally have periods stripped, I'd consider that widely expected behavior. @tech4him1 |
@erquhart @talves Looking at the |
@tech4him1 since we're only using this check in one place and not for general extension checking, just using |
@erquhart Hmm, yeah. Probably not a bad idea to run a sanitize function on it as well, in case a user tries to do something weird like |
Yep, I'm good with that. |
- Do you want to request a feature or report a bug?
bug hunt πΎ
- What is the current behavior?
Entries that have a complex extensionΒ β eg:
html.md
βΒ can be created in the CMS, but do not appear in the collection view.- If the current behavior is a bug, please provide the steps to reproduce.
Set
extension: "html.md"
andformat: frontmatter
. In the CMS, create a new entry in that collection. Entry is committed successfully, with the custom extension. Entry does not appear in the collection view.- What is the expected behavior?
Entry should appear in the collection view.
- Please mention your CMS, node.js, and operating system version.
Netlify CMS version 0.7.6, deployed to Netlify
The text was updated successfully, but these errors were encountered: