Home
Support Forums

Netlify CMS for Hugo data

I can’t manage to make Hugo data files content appear in Netlify CMS, what am I doing wrong?
Maybe it has something to do with the identifier field, or the collections/fields structure?

API ID: b44a9bd9-b9f6-423c-87e5-0e68297e4304
Config: algo-website/config.yml at main · algosphere/algo-website · GitHub
Data: algo-website/algonewsold.yml at main · algosphere/algo-website · GitHub

The outline of what I want (which is doable according to my understanding) is the following:

But I have a blank list of entries:

I can split my data file into a folder collection if it is really needed for this to work.

Your list has to be named after your widget:

publications:
  - title: ...

Do you mean I rename “fields:” to “publications:” ?
Like so:

collections:
  - label: "Données"
    name: "data"
    identifier_field: name
    files:
      - label: "Algonews"
        name: "algonews"
        file: "data/algonewsold.yml"
        preview_path: resources/algonews
        fields:
          - label: Publications
            name: publications
            widget: list
            add_to_top: true
            publications:
              - {label: Titre, ...

I’m not sure to understand, can you provide a code snipet starting from “collections:” all the way to the list fields please?

You have an unnamed list in your data, which the cms can’t read. You have to name it:

data.yml:

publications:
  - name: "AlgoNews #30 (Summer 2021)"
    year: "2021"
    url: ...

3 Likes