-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
✨ 🐛 Move meta description into ghost head #8150
Conversation
Hmmm... thinking about this some more - did I jump the 🔫 by moving the title into I thought it would be easier to do both - then users don't have to think about any meta data at all, but then I got to thinking how the structure of a head section is usually:
And wondered if it would be weird to have title output so far down? I know the search engines don't care but mebbe this is confusing for developers? |
closes TryGhost#4424 - meta description is an optional SEO tag that we can provide when we have sensible output - in the cases where we have no useful output, we should not output the tag at all - ghost_head now takes care of this, and themes should not include their own meta description tag
Based on the above (and with approval from JO'N) I have updated this PR to ONLY move meta description into ghost head. There is no bug with the title, the title is always required, and it is normal to put it at the top of the markup. There is no benefit to moving it into ghost_head and requiring developers to change their themes. However, meta description is a different case. It is optional. Search engines won't penalise you for not including it, or for having two (it would just grab the first one) but what will result in problems is having a tag with an empty content attribute as we have had in Ghost for such a long time. By moving meta description into ghost_head we give ghost full control over the meta description to only output it when we have something sensible to output. Moving forward we can look to making it possible to detect if there is a meta description available, but that is not required in order to make this change. |
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.
LGTM 👍
@ErisDS will update casper, because otherwise we would have two meta descriptions in the head.
refs TryGhost/Ghost#4424 - as of TryGhost/Ghost#8150, `{{ghost_head}}` will output the meta description if Ghost is able to determine a sensible value to output.
refs TryGhost/Ghost#4424 - as of TryGhost/Ghost#8150, `{{ghost_head}}` will output the meta description if Ghost is able to determine a sensible value to output
refs TryGhost/Ghost#4424 - as of TryGhost/Ghost#8150, `{{ghost_head}}` will output the meta description if Ghost is able to determine a sensible value to output.
refs TryGhost/Ghost#4424 - as of TryGhost/Ghost#8150, `{{ghost_head}}` will output the meta description if Ghost is able to determine a sensible value to output.
closes #4424
This is the final major functional change that I want to get into Ghost 1.0 for themes.
The idea, based on the discussion in #4424, is to move the meta title and meta description tags to be output in ghost head.
Meta title is always set, this has no effect other than some very old themes will have duplicate titles. We can implement a warning for this in gscan. I believe search engines use the first if there are 2.
Meta description is not always set. With this change, if it is unset, we don't output a meta description tag. This will also have the same issue where old themes will get duplicates & again we can add this as a warning in gscan.
Note that this change still does not allow us to do this in the templates:
because meta description is still a function.
I've been holding off on making this change, because I thought I also needed to fix the ability to do an if statement on meta_description. However, having thought about it some more I can't think of a really good usecase. I mean, it's nice-to-have, but there's no clear-as-day jumps out at me reason other than my brain telling me we probably should allow it.
Adding the ability to do this later also would be an addition, rather than a breaking change so no reason to hold off the breaking change for Ghost 1.0 based on this... I think.
Thoughts please @JohnONolan ?