- Do you want to request a feature or report a bug?
Report a bug.
- What is the current behavior?
If your entries end with the .markdown extension, rather than .md, links are generated improperly. This type of file naming scheme is the default for middleman-blog.
- If the current behavior is a bug, please provide the steps to reproduce.
.markdown- What is the expected behavior?
It should load the entry.
- What is the actual behavior?
It throws an "Entry not found" error.
- Please mention your node.js, and operating system version.
node version: 6.9.5
OS: Mac OS X 10.12.3
Using Middleman
The easy workaround here is to just change the filename extension on your entries to .md, instead. This is still supported by middleman-blog.
Thanks @techpeace, this makes sense.
If anyone is up for taking this on, it should be a simple fix.
I took a look quick look at this.
With the test repo: if you put a post with .markdown in the path in the posts array, then the collection view displays fine, but the editor for the item does not. selectEntryPath assumes all files in the collection have the same extension '.md' unless you explicitly change this in your collection settings.
So one fix is to add extension: "markdown" to your collection.
Need to test with a real repo to see if behaviour is the same.
One option that seems relatively easily is to include another path or query parameter in the route to optionally provide the extension. If provided, netlify-cms should use that as the file extension.
Another is to change the list files approach to only display files when they match the collection extension.
This would mean Netlify can support extensions with multiple extensions, but would only write out a single extension. It might be worth raising a separate to issue to add a chooser for file extension when creating a file for the first time.
The CMS should still support .markdown files by default.
@Benaiah @tech4him1 is this still an issue?
I believe so, the issue still is that selectEntryPath assumes all files in the collection have the same extension, and it filters out every file that does not have the same extension. md is the default, or whichever one is set for extension in the config.
After an attempt at implementing default support for .markdown as well as .md via allowing multiple extensions per collection, we've concluded that it's not feasible to do in a performant and unobtrusive manner. You can still use .markdown as the extension, but you must set it explicitly in the collection as noted above.
Somewhat related, since upgrading to v4, I have noticed that my title.md files aren't being picked up, only title.html.md files are.
Oops. For some reason I thought this was the middleman-blog repo. This is an issue I'm having with middleman-blog, not with this project. Sorry for the confusion.
For others that stumble here, I fixed it by adding extension: "html.md" and format: frontmatter to the netlify-cms config.yml.
Most helpful comment
For others that stumble here, I fixed it by adding
extension: "html.md"andformat: frontmatterto the netlify-cmsconfig.yml.