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

New posts don't work #171

Closed
brianrc opened this issue Nov 25, 2016 · 9 comments
Closed

New posts don't work #171

brianrc opened this issue Nov 25, 2016 · 9 comments

Comments

@brianrc
Copy link

brianrc commented Nov 25, 2016

- Do you want to request a feature or report a bug?
bug
- What is the current behavior?
submitting new post hangs and doesn't upload anything to my git repo
- If the current behavior is a bug, please provide the steps to reproduce.
create new post -> enter in test info and submit -> errors in console
- What is the expected behavior?
new post uploaded to repo
- Please mention your node.js, and operating system version.
site deployed using your defaults: node v6.9.1 and Google Chrome Version 54.0.2840.99 m (64-bit)

capture

@biilmann
Copy link
Contributor

Which version of the CMS are you using? This ought to be fixed in the newest release, but let me know if that's not the case...

@brianrc
Copy link
Author

brianrc commented Nov 25, 2016

I guess it's this one:

<script src="https://unpkg.com/netlify-cms/dist/cms.js"></script>

@cassiozen
Copy link

Hi @brianrc. Can you share your config.yml file? I'll try to replicate your setup here.

@brianrc
Copy link
Author

brianrc commented Nov 28, 2016

@cassiozen
Copy link

I'm taking a look right now.

@cassiozen
Copy link

Found the error, @brianrc :

In your config file, you need to add a slug configuration. Something like:

collections:
  - name: "post"
    label: "Post"
    folder: "content/posts"
    create: true
    slug: "{{slug}}"
    fields:
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Body", name: "body", widget: "markdown"}
      - {label: "Layout", name: "layout", widget: "string", default: "Post"}
    meta:
      - {label: "Publish Date", name: "date", widget: "datetime"}

The slug can contain the special keys day, month and year. For example:

slug: "{{year}}-{{month}}-{{day}}-{{slug}}"

Now, the CMS can certainly handle this better. I'll make the CMS assume a default slug format if none is provided.

@brianrc
Copy link
Author

brianrc commented Nov 29, 2016

Thank you. That makes sense. It's saving to github now, but it's still not really working though.

It needs to produce output like this:

---
title: This is a title
date: 2016-02-14
layout: Post
---

This is the body.

Instead it's producing output like so:

---
path: content/posts/this-is-a-title.md
title: This is a title
---

This is the body.

Where did path come from and why is it ignoring layout and date?

@cassiozen cassiozen reopened this Nov 30, 2016
@cassiozen
Copy link

Humm, I see. Let me take a look.

@cassiozen
Copy link

Hi @brianrc. Just published a new release (0.1.9) and your issues should be resolved.

I'll close this for now. Thanks a lot for working on this with us. If there's any other problems, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants