decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.98k stars 3.05k forks source link

Collection files are ignored #2775

Closed Keized closed 4 years ago

Keized commented 5 years ago

Hi, i have a little issue, all my collection files are ignored I created 2 collections:

When I'm using the 'test-repo' backend :

When I'm using the 'test-repo' backend :

My gatsby-config

module.exports = {
  siteMetadata: {
    title: `blog`,
  },
  plugins: [
    `gatsby-plugin-netlify-cms`,

    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `${__dirname}/content/blog`,
        name: `blog`,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `${__dirname}/content/pages`,
        name: `pages`,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `${__dirname}/content/assets`,
        name: `assets`,
      },
    },
    {
      resolve: `gatsby-transformer-remark`,
      options: {
        plugins: [
          {
            resolve: `gatsby-remark-images`,
            options: {
              maxWidth: 590,
            },
          },
          {
            resolve: `gatsby-remark-responsive-iframe`,
            options: {
              wrapperStyle: `margin-bottom: 1.0725rem`,
            },
          },
          `gatsby-remark-prismjs`,
          `gatsby-remark-copy-linked-files`,
          `gatsby-remark-smartypants`,
        ],
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-feed`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `Gatsby Starter Blog`,
        short_name: `GatsbyJS`,
        start_url: `/`,
        background_color: `#ffffff`,
        theme_color: `#663399`,
        display: `minimal-ui`,
        icon: `content/assets/gatsby-icon.png`,
      },
    },
    `gatsby-plugin-offline`,
    `gatsby-plugin-react-helmet`
  ],
}

My /static/admin/config.yml

backend:
  name: test-repo
  branch: master

media_folder: static/assets
public_folder: /assets

collections:
  - name: "blog"
    label: "Blog"
    folder: "content/blog"
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Publish Date", name: "date", widget: "datetime" }
      - { label: "Description", name: "description", widget: "string" }
      - { label: "Body", name: "body", widget: "markdown" }

  - name: "pages"
    label: "Pages"
    delete: false
    files:
      - label: "Homepage"
        name: "homepage"
        file: "/site/content/pages/homepage.md"
        fields:
          - { label: "Title", name: "title", widget: "string" }
          - { label: "Description", name: "description", widget: "string" }
          - { label: "Body", name: "body", widget: "markdown" }
      - label: "Contact"
        name: "contact"
        file: "/site/content/pages/contact.md"
        fields:
          - { label: "Title", name: "title", widget: "string" }
          - { label: "Description", name: "description", widget: "string" }
          - { label: "Body", name: "body", widget: "markdown" }
      - label: "Showroom"
        name: "showroom"
        file: "/site/content/pages/showroom.md"
        fields:
          - { label: "Title", name: "title", widget: "string" }
          - { label: "Description", name: "description", widget: "string" }
          - { label: "Body", name: "body", widget: "markdown" }
erezrokah commented 5 years ago

Hi @Keized and thank you for opening this issue. The test-repo only works from browser memory and will not load/save any files from/to your repository. It is only meant for trying out the UI.

Where are your posts/pages stored? You might need to follow the instructions here to get this working.

Also, sharing the repo would be very helpful (if possible).

erezrokah commented 4 years ago

Closing to due lack of response