-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Conversation
👍 |
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! |
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. |
@@ -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 %}" /> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?”
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @XhmikosR Thanks.
Ah, I totally overlooked this. Good idea! Thank you. |
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