-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Don't output meta tags with blank content #4424
Comments
Hey @novaugust this is unfortunately not a simple issue to fix, I was working on raising it but haven't figured out what to do yet. This is non-trivial to fix because the
We need to either make it possible to check if a helper has a value or move the output of the meta title and description into Making it possible to check a helper is tricky because it means either coming up with some sort of helper to do it like Moving the output of meta tags/description into ghost_head isn't so tricky, but means that there will be an overlap where most themes will have duplicate tags, which requires a bit of research into what kind of impact that will have. We could also change the |
What if new helper: {{#if_not_empty meta_description}}
<meta name="description" content="{{meta_description}}" />
{{/if_not_empty}} |
Actually, would an empty string even trigger an `{{#if}}``? EDIT: no. If {{meta_description}} is empty, then {{#if}} doesn't trigger. :) Sauce: http://tryhandlebarsjs.com/ So basically:
|
@javorszky I think the problem is, |
@novaugust aren't helpers are of the syntax |
Like I said, I need to look in the code to see what's actually going on. On Mon, Nov 10, 2014 at 1:26 PM, Gabor Javorszky [email protected]
|
A description meta element has nothing other than
Since we've decided to put the option to set or turn off (by leaving blank) the meta description inside Ghost UI, I don't see why or what advantage we gain from allowing theme developers to mess around with it? i.e.
Besides, the W3 spec says "The value must be a free-form string that describes the page." and there's no sensible method or reason to disable the meta options in Ghost UI and set them to fixed values, unique to every page from within the theme. If people really want to do something like this code example, I don't see why someone couldn't make a Meta Description Prepender & Appender App! On a serious note though, someone who thinks they can write a better algorithm than Google for detecting and summarising what a page is about could well make an App that fills in the blanks if the user leaves it empty. I'm sure all the SEO-mad bloggers would love it. I'd say put it in |
hey guys, some problem here. I understand that the first purpose for so, IMHO, basically the right way should be, if the variable is empty, get the html content of the first paraph like the preview. Use I read that moz says that is better uses empty string that random text. maybe something intermediate like use the first the of the post since the first dot? lol |
So: outputting an empty meta description is definitely completely wrong. We shouldn't be doing that. However: outputting any random content as a custom meta description is actually worse for SEO, not better. If you don't enter a meta description, Google will choose the most relevant content to the search term on the page to display as the meta description - which is far better. More info: http://moz.com/learn/seo/meta-description One option is what @javorszky said:
however I'm intrigued by @joeldrapper's suggestion. He's actually right, I can't think of a compelling reason why meta description needs to be in the theme rather than in Other than: It's slightly un-obvious so maybe theme authors would end up duplicating it cause they don't understand why it's not there? Not sure. |
@JohnONolan If an app or setting could optionally append I don't think theme authors would duplicate the tags if it was made very clear in the theme documentation what was included in |
This wormed it's way into my brain again recently.
We could certainly output both the title and description in the
None of these are particularly terrible, they just make things a tad more complicated than they would otherwise be, so I thought up some other options: I'm not a fan of the idea of modifying the 1. Use the
|
I'm very in favour of moving the whole thing into ghost_head. The helpers are still relevant - Theme authors may want to output meta content in other places - but I guess that could be a data helper instead of a custom one or whatever |
Was this feature added? I'm trying to find a way to print a page's meta_description if it is present in the page settings. |
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
closes #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
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.
If a user doesn't enter anything for their post's meta description, the meta description tag is still output but with an empty content, like:
<meta name="description" content="">
If the content is empty, the tag should never be output in the first place.
Ref this comment
The text was updated successfully, but these errors were encountered: