Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(starters): add meta description for SEO and Open Graph to Gatsby Starter Blog #11936

Merged
merged 2 commits into from Feb 22, 2019

Conversation

Projects
None yet
4 participants
@nielsenjared
Copy link
Contributor

nielsenjared commented Feb 20, 2019

Minor additions to allow for optional custom meta description front matter field for SEO and Open Graph purposes; plus demo.

Changes proposed:

  • Add description to frontmatter query in src/pages/index.js and src/templates/blog-post.js
  • Add short-circuit evaluation for frontmatter.description in posts mapping (index.js) and SEO component (blog-post.js)
  • Add description field to hi-folks/index.md to demonstrate use

@nielsenjared nielsenjared requested a review from gatsbyjs/core as a code owner Feb 20, 2019

@DSchau DSchau changed the title Add meta description for SEO and Open Graph to Gatsby Starter Blog feat(starters): add meta description for SEO and Open Graph to Gatsby Starter Blog Feb 20, 2019

@wardpeet

This comment has been minimized.

Copy link
Contributor

wardpeet commented Feb 22, 2019

😮 this is niffty! if you could fix your linting that would be awesome!

nielsenjared and others added some commits Feb 20, 2019

@sidharthachatterjee sidharthachatterjee force-pushed the nielsenjared:meta-description branch from 1b64fb2 to 0b014cf Feb 22, 2019

@sidharthachatterjee

This comment has been minimized.

Copy link
Member

sidharthachatterjee commented Feb 22, 2019

Fixed the linting issue and rebased on master! starters_validate is unrelated

@sidharthachatterjee
Copy link
Member

sidharthachatterjee left a comment

Looks great! 👍 Just left a small comment @nielsenjared

@@ -1,6 +1,7 @@
---
title: New Beginnings
date: "2015-05-28T22:40:32.169Z"
description: This is a custom description for SEO and Open Graph purposes, rather than the default generated excerpt. Simply add a description field to the frontmatter.

This comment has been minimized.

@sidharthachatterjee

sidharthachatterjee Feb 22, 2019

Member

Just a small nit. I'd make the sample description more generic since it could be used for other purposes too and since this is a widely used starter 🙂

This comment has been minimized.

@sidharthachatterjee

sidharthachatterjee Feb 22, 2019

Member
Suggested change
description: This is a custom description for SEO and Open Graph purposes, rather than the default generated excerpt. Simply add a description field to the frontmatter.
description: Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.
@DSchau

DSchau approved these changes Feb 22, 2019

Copy link
Contributor

DSchau left a comment

@sidharthachatterjee going to merge, mostly because I kinda like the idea of "example as documentation" here.

If someone looks at that post, they'll see how it's supposed to be used which probably is a good idea.

Merging this out. Thanks for the contribution!

@DSchau DSchau merged commit 1f6d464 into gatsbyjs:master Feb 22, 2019

13 of 14 checks passed

ci/circleci: starters_validate Your tests failed on CircleCI
Details
Peril All green. Nice work.
Details
ci/circleci: bootstrap Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_development_runtime Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_gatsby-image Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_gatsbygram Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_path-prefix Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_production_runtime Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_gatsby_pipeline Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_long_term_caching Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node10 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node6 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node8 Your tests passed on CircleCI!
Details
@gatsbot

This comment has been minimized.

Copy link

gatsbot bot commented Feb 22, 2019

Holy buckets, @nielsenjared — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.