Skip to content

Instantly share code, notes, and snippets.

@BrunoBoehm
Last active August 12, 2018 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrunoBoehm/d5cc4b5dbdbcc6f9d3c1cdc182aee241 to your computer and use it in GitHub Desktop.
Save BrunoBoehm/d5cc4b5dbdbcc6f9d3c1cdc182aee241 to your computer and use it in GitHub Desktop.
Gatsby + Netlify + NetlifyCMS
collections:
- name: "list"
label: "List"
folder: "src/pages/lists"
create: true
slug: "{{slug}}"
fields:
- {label: "Template Key", name: "templateKey", widget: "hidden", default: "list-page"}
- {label: "Title", name: "title", widget: "string"}
- {label: "Description", name: "description", widget: "text"}
- {label: "Body", name: "body", widget: "markdown"}
- {label: "Tags", name: "tags", widget: "list", required: false}
editor: false
- name: "pages"
label: "Pages"
files:
- file: "src/pages/lists/index.md"
label: "Lists"
name: "lists"
fields:
- {label: "Template Key", name: "templateKey", widget: "hidden", default: "lists-page"}
- {label: "Title", name: "title", widget: "string"}
- {label: "Body", name: "body", widget: "markdown"}
templateKey path title description
lists-page
/lists
All Lists
A great description

First Title

Hello

import React from 'react';
const ListsPage = ( {data} ) => {
const { markdownRemark: post } = data;
return(
<div className="section">
<h2 className="title is-size-3 has-text-weight-bold is-bold-light">{post.frontmatter.title}</h2>
<p>{post.frontmatter.description}</p>
</div>
);
};
export default ListsPage;
export const ListsPageQuery = graphql`
query ListsPage($id: String!) {
markdownRemark(id: {eq: $id}) {
frontmatter {
title
templateKey
description
}
}
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment