scttcper / gatsby-casper

A Casper blog starter for Gatsby

Home Page:https://gatsby-casper.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Post excerpt is not used in twitter card

smknstd opened this issue · comments

When defining an excerpt for a given post:

---
layout: post
title: My title
excerpt: My excerpt
---
My post content

the twitter card description (and other social cards as well) is made from post content. I'm expecting the excerpt to be used.

To fix this I think it should be :

<meta name="twitter:description" content={post.frontmatter.excerpt || post.excerpt} />

instead of:

<meta name="twitter:description" content={post.excerpt} />

in src/templates/post.tsx

What do you think ?

thanks for the suggestion!

same problem with excerpt not used on both tags and author page

i don't think those pages use the excerpt?

I think for the post description on https://gatsby-casper.netlify.app/tags/source/ it shoud use the excerpt : "Where to find this project on GitHub." as on the homepage. Same for all posts on https://gatsby-casper.netlify.app/author/ghost/

#80 might fix this