[add] Page specific meta descriptions, the easy way #2964

Merged
merged 1 commit into from Oct 5, 2014

Conversation

Projects
None yet
6 participants
@nternetinspired
Contributor

nternetinspired commented Sep 30, 2014

Rather than have duplicate page descriptions across all pages of the site it's beneficial to have page-specific meta descriptions.

Background

Matt Cutts says duplicate meta descriptions are not cool:

http://youtu.be/W4gr88oHb-k

Proposed solution

We could set a unique description in each post front-matter and use that, but for the sake of laziness and ease-of-use it's far easier to grab the excerpt and use that instead. If there isn't one, fall back to the site description.

Testing

Check that the post 0000-00-00-welcome-to-jekyll now has it's own meta description, whilst the homepage uses the site.description

@nternetinspired nternetinspired changed the title from Page specific meta descriptions, the easy way to [add] Page specific meta descriptions, the easy way Sep 30, 2014

@pathawks

This comment has been minimized.

Show comment
Hide comment
@pathawks

pathawks Sep 30, 2014

Member

👍

Member

pathawks commented Sep 30, 2014

👍

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Oct 5, 2014

Member

Cool. In the future, I'd like to know what best practices are and what make for the best websites, not what some visionary has to say about it. I can intuit that based on the change, but let's leave Matt Cutts out of pull requests and use published standards from places like Google.

Thanks!

Member

parkr commented Oct 5, 2014

Cool. In the future, I'd like to know what best practices are and what make for the best websites, not what some visionary has to say about it. I can intuit that based on the change, but let's leave Matt Cutts out of pull requests and use published standards from places like Google.

Thanks!

@parkr parkr merged commit 7a2f7a5 into jekyll:master Oct 5, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

parkr added a commit that referenced this pull request Oct 5, 2014

@nternetinspired

This comment has been minimized.

Show comment
Hide comment
@nternetinspired

nternetinspired Oct 6, 2014

Contributor

Thanks for merging :)

I'm a little confused though about your reference to Matt Cutts. As the engineer in charge of search quality at Google I think he's pretty well placed to provide good answers in this respect and published standards in this vein at Google are typically posted by him.

The official Google detail on meta descriptions is currently found on this page, https://support.google.com/webmasters/answer/35624, which as you'll notice also contains a video from Matt Cutts describing how Google creates snippets for listings and referring repeatedly to meta descriptions.

Contributor

nternetinspired commented Oct 6, 2014

Thanks for merging :)

I'm a little confused though about your reference to Matt Cutts. As the engineer in charge of search quality at Google I think he's pretty well placed to provide good answers in this respect and published standards in this vein at Google are typically posted by him.

The official Google detail on meta descriptions is currently found on this page, https://support.google.com/webmasters/answer/35624, which as you'll notice also contains a video from Matt Cutts describing how Google creates snippets for listings and referring repeatedly to meta descriptions.

@nternetinspired nternetinspired deleted the nternetinspired:meta-description branch Oct 6, 2014

@@ -4,7 +4,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
- <meta name="description" content="{{ site.description }}">
+ <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | truncate: 160 }}{% else %}{{ site.description }}{% endif %}" />

This comment has been minimized.

@XhmikosR

XhmikosR Oct 8, 2014

Contributor

The end tag here wasn't needed BTW.

@XhmikosR

XhmikosR Oct 8, 2014

Contributor

The end tag here wasn't needed BTW.

This comment has been minimized.

@XhmikosR

XhmikosR Oct 8, 2014

Contributor

I would also add strip_newlines after strip_html since I end up with a newline here.

@XhmikosR

XhmikosR Oct 8, 2014

Contributor

I would also add strip_newlines after strip_html since I end up with a newline here.

This comment has been minimized.

@pathawks

pathawks Oct 8, 2014

Member

What do you mean “The end tag here wasn't needed?”

@pathawks

pathawks Oct 8, 2014

Member

What do you mean “The end tag here wasn't needed?”

This comment has been minimized.

@XhmikosR

XhmikosR Oct 8, 2014

Contributor

/> -> >. I already made the changes in #2982.

@XhmikosR

XhmikosR Oct 8, 2014

Contributor

/> -> >. I already made the changes in #2982.

This comment has been minimized.

@nternetinspired

nternetinspired Oct 8, 2014

Contributor

Good catch @XhmikosR Thanks.

@nternetinspired

nternetinspired Oct 8, 2014

Contributor

Good catch @XhmikosR Thanks.

@kleinfreund

This comment has been minimized.

Show comment
Hide comment
@kleinfreund

kleinfreund Nov 11, 2014

Contributor

Ah, I totally overlooked this. Good idea! Thank you.

Contributor

kleinfreund commented Nov 11, 2014

Ah, I totally overlooked this. Good idea! Thank you.

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.