site: add Dwolla blog post, add support for canonical URLs (#2357)

* Add blog post about implementing the CMS with Jekyll, add support for canonical URLs

* fix formatting

* add cross post link
This commit is contained in:
Shea Daniels
2019-06-07 11:56:58 -05:00
committed by Shawn Erquhart
parent 91702c2ae7
commit d128d7d001
4 changed files with 476 additions and 1 deletions

View File

@ -182,6 +182,18 @@
}
}
figure {
margin-left: 0;
.gatsby-highlight {
margin-top: -20px;
}
}
figcaption {
font-style: italic;
}
:not(pre) > code {
color: inherit;
background: $lightestGrey;

View File

@ -24,7 +24,15 @@ export const BlogPostTemplate = ({ title, author, date, body, html }) => (
const BlogPost = ({ data }) => {
const { html, frontmatter } = data.markdownRemark;
const { author, title, date, description, meta_description, twitter_image } = frontmatter;
const {
author,
title,
date,
description,
meta_description,
twitter_image,
canonical_url,
} = frontmatter;
const { siteUrl } = data.site.siteMetadata;
const twitterImageUrl =
twitter_image && `${trimEnd(siteUrl, '/')}/${trimStart(twitter_image, '/')}`;
@ -36,6 +44,7 @@ const BlogPost = ({ data }) => {
<Helmet>
<title>{title}</title>
{desc && <meta name="description" content={desc} />}
{canonical_url && <link rel="canonical" href={canonical_url} />}
</Helmet>
<TwitterMeta title={title} description={desc} image={twitterImageUrl} />
<BlogPostTemplate title={title} author={author} date={date} html={html} />
@ -60,6 +69,7 @@ export const pageQuery = graphql`
date(formatString: "MMMM D, YYYY")
author
twitter_image
canonical_url
}
html
}