Skip to content

Commit

Permalink
Merge pull request #76 from newrelic/zstickles/page-specific-metadata
Browse files Browse the repository at this point in the history
Added ability to set page-specific meta information
  • Loading branch information
zstix authored May 30, 2020
2 parents 1dcce4b + f1ce455 commit f64d5f9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/markdown-pages/add-time-picker-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ path: '/build-apps/add-time-picker-guide'
duration: '20 min'
title: 'Add the time picker to a sample application'
template: 'GuideTemplate'
description: 'Example guide page'
---


Expand Down
1 change: 1 addition & 0 deletions src/markdown-pages/example.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ path: '/guides/graphql-api'
duration: '30 min'
title: 'GraphQL API'
template: 'GuideTemplate'
description: 'Example guide page'
---

## Lorem ipsum
Expand Down
1 change: 1 addition & 0 deletions src/markdown-pages/foo-bar-baz.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ path: '/foo/baz'
duration: '0 min'
title: 'Baz'
template: 'GuideTemplate'
description: 'Foo Baz page description goes here'
---

## This is the Baz page within Foo
Expand Down
1 change: 1 addition & 0 deletions src/markdown-pages/foo-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ path: '/foo/bar'
duration: '0 min'
title: 'Bar'
template: 'GuideTemplate'
description: 'Foo Bar page description goes here'
---

## This is the Bar page within Foo
Expand Down
1 change: 1 addition & 0 deletions src/markdown-pages/guide-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ path: '/guides'
duration: '0 min'
title: 'Guides'
template: 'GuideTemplate'
description: 'Guide page description'
---

## This is the top-level guide page
Expand Down
6 changes: 5 additions & 1 deletion src/templates/GuideTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Layout from '../components/Layout';
import BreadcrumbBar from '../components/BreadcrumbBar';
import Container from '../components/Container';
import Video from '../components/Video';
import SEO from '../components/Seo';

import createBreadcrumbs from '../utils/create-breadcrumbs';
import pages from '../data/sidenav.json';
Expand All @@ -21,16 +22,18 @@ const components = {
const GuideTemplate = ({ data }) => {
const { mdx } = data;
const { frontmatter, body } = mdx;
const { title, description } = frontmatter;

const crumbs = createBreadcrumbs(frontmatter.path, pages);

return (
<Layout>
<SEO title={title} description={description} />
<BreadcrumbBar crumbs={crumbs} duration={frontmatter.duration} />
<Container>
<div className="guideTemplate-container">
<div>
<h1>{frontmatter.title}</h1>
<h1>{title}</h1>
<div className="guideTemplate-content">
<MDXProvider components={components}>
<MDXRenderer>{body}</MDXRenderer>
Expand All @@ -55,6 +58,7 @@ export const pageQuery = graphql`
duration
path
title
description
}
}
}
Expand Down

0 comments on commit f64d5f9

Please sign in to comment.