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

Entries with .markdown extension don't work #317

Closed
techpeace opened this Issue Mar 21, 2017 · 10 comments

Comments

@techpeace
Copy link

techpeace commented Mar 21, 2017

- 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.

  1. Create a blog source entry with a name ending in .markdown
  2. Attempt to access the entry from the Netlify CMS UI.

- 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

@techpeace

This comment has been minimized.

Copy link
Author

techpeace commented Mar 21, 2017

The easy workaround here is to just change the filename extension on your entries to .md, instead. This is still supported by middleman-blog.

@erquhart

This comment has been minimized.

Copy link
Member

erquhart commented Mar 22, 2017

Thanks @techpeace, this makes sense.

@erquhart

This comment has been minimized.

Copy link
Member

erquhart commented Mar 29, 2017

If anyone is up for taking this on, it should be a simple fix.

@josephearl

This comment has been minimized.

Copy link
Contributor

josephearl commented Apr 12, 2017

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.

@erquhart

This comment has been minimized.

Copy link
Member

erquhart commented Jun 27, 2017

The CMS should still support .markdown files by default.

@erquhart erquhart added this to the 1.0 milestone Jun 27, 2017

@erquhart erquhart added this to Sprint 5 (11/9 - 11/22) in Sprint Planning | Sprint 6 (11/23 - 12/6) Sep 13, 2017

@erquhart erquhart removed this from Sprint 5 (11/9 - 11/22) in Sprint Planning | Sprint 6 (11/23 - 12/6) Sep 13, 2017

@erquhart erquhart added this to Ready for Assignment in Sprint Planning | Sprint 6 (11/23 - 12/6) Oct 11, 2017

@Benaiah Benaiah self-assigned this Oct 27, 2017

@Benaiah Benaiah moved this from Ready for Assignment to Assigned in Sprint Planning | Sprint 6 (11/23 - 12/6) Oct 27, 2017

@Benaiah Benaiah moved this from Assigned to Ready for Assignment in Sprint Planning | Sprint 6 (11/23 - 12/6) Oct 27, 2017

@Benaiah Benaiah moved this from Ready for Assignment to Assigned in Sprint Planning | Sprint 6 (11/23 - 12/6) Oct 27, 2017

@Benaiah Benaiah moved this from Assigned to In Progress in Sprint Planning | Sprint 6 (11/23 - 12/6) Nov 13, 2017

@erquhart

This comment has been minimized.

Copy link
Member

erquhart commented Nov 27, 2017

@Benaiah @tech4him1 is this still an issue?

@tech4him1

This comment has been minimized.

Copy link
Collaborator

tech4him1 commented Nov 27, 2017

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.

@Benaiah

This comment has been minimized.

Copy link
Contributor

Benaiah commented Nov 28, 2017

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.

@Benaiah Benaiah closed this Nov 28, 2017

@Benaiah Benaiah moved this from In Progress to Complete in Sprint Planning | Sprint 6 (11/23 - 12/6) Nov 28, 2017

@bostonaholic

This comment was marked as off-topic.

Copy link

bostonaholic commented Jan 6, 2018

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.

@wayferer

This comment has been minimized.

Copy link

wayferer commented Jun 20, 2018

For others that stumble here, I fixed it by adding extension: "html.md" and format: frontmatter to the netlify-cms config.yml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.