Blog sorting not working, what am I doing wrong

I exported my blog posts from another CMS, I have the date\timestamp in ISO in the JSON
{

“publishedAt”: “2011-09-09T01:36:15.0000000Z”,

}

The sort in the config.yaml is
sort: ‘publishedAt:desc’

But nothing in Nuxt or the netlify CMS is sorting by that descending

What am I doing wrong? Is it the date format or something?

hmm, I don’t see the sort option in the config.yml docs here: https://www.netlifycms.org/docs/configuration-options/ All I see there is sortableFields.

Maybe you could share your entire config.yaml for the CMS, and let us know where you saw the sorting described?

How nuxt sorts things would be up to them and our Support team aren’t heavy users of nuxt so our advice will be limited to “did it work locally in your nuxt installation? That’s probably a better place to start figuring out nuxt than here”, but we can potentially help with the CMS issue at least!

This is where I was thinking it was coming from

  - name: 'blog'
    label: 'Blog'
    folder: 'app/content/blog'
    create: true
    slug: '{{slug}}'
    format: 'json'
    sort: 'publishedAt:desc'
    fields:
      - { label: Title, name: title, widget: string }
      - { label: 'Published At', name: publishedAt, widget: date, format: 'Do MMM YYYY' }
      - { label: Content, name: content, widget: markdown }
      - { label: 'Featured Image', name: featuredImage, widget: image, required: false }
      - { label: 'SEO Description', name: seoDescription, widget: text, required: false }
      - { label: 'SEO Meta Image', name: seoMetaImage, widget: image, required: false }

But I guess thats just the netlify CMS backend then?

Yeah I figured it out, there was a helper that populated the store, I added my published property to that then just sorted it :+1:

1 Like