-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[part-09] Added a custom template for "design" detail pages
- Updated page creation filters to include "design" contentKeys along with "page" - Added links to the designs listing page
- Loading branch information
Showing
3 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// src/templates/design-template.js | ||
|
||
import { graphql } from 'gatsby'; | ||
import React from 'react' | ||
import Layout from '../components/Layout.js'; | ||
|
||
const DesignTemplate = (props) => { | ||
|
||
console.log(props.data); | ||
|
||
return ( | ||
<Layout> | ||
<div> | ||
<h1>Design Content Template</h1> | ||
<div>{props.data.markdownRemark.frontmatter.title}</div> | ||
<div>{props.data.markdownRemark.frontmatter.description}</div> | ||
</div> | ||
</Layout> | ||
) | ||
} | ||
|
||
export const query = graphql` | ||
query($pageId: String = "") { | ||
markdownRemark( | ||
id: { eq: $pageId } | ||
) { | ||
id | ||
frontmatter { | ||
title | ||
description | ||
} | ||
} | ||
} | ||
` | ||
|
||
export default DesignTemplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters