templateKey | path | title | description |
---|---|---|---|
lists-page |
/lists |
All Lists |
A great description |
Hello
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"} |
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 | |
} | |
} | |
} | |
`; |