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

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

Merged
merged 1 commit into from
Oct 5, 2014
Merged

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

merged 1 commit into from
Oct 5, 2014

Conversation

nternetinspired
Copy link
Contributor

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 Page specific meta descriptions, the easy way [add] Page specific meta descriptions, the easy way Sep 30, 2014
@pathawks
Copy link
Member

👍

@parkr
Copy link
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
parkr added a commit that referenced this pull request Oct 5, 2014
@nternetinspired
Copy link
Contributor Author

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 meta-description branch October 6, 2014 13:20
@@ -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 %}" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end tag here wasn't needed BTW.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @XhmikosR Thanks.

@kleinfreund
Copy link

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants