Created
January 6, 2015 13:43
-
-
Save ofstudio/01f251538560dbf7ee1a to your computer and use it in GitHub Desktop.
Meta tags snippet for Ghost Themes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
partials/meta.hbs
Meta tags snippet for Ghost Themes
Tested on Ghost 0.5.7. IMPORTANT! Some things are more likely to work in a different way in future versions of Ghost. Check Ghost documentation first.
Generates meta tags block like this
For index views
{{@blog.title}}
{{@blog.description}}
website
{{@blog.url}}{{{relativeUrl}}}
{{@blog.title}}
{{@blog.url}}{{@blog.cover}}
if blog cover existsFor tag views
Posts with tag “{{tag.name}}” — {{@blog.title}}
{{@blog.description}}
website
{{@blog.url}}{{{relativeUrl}}}
{{@blog.title}}
{{@blog.url}}{{@blog.cover}}
if blog cover existsFor author views
Posts by {{author.name}} — {{@blog.title}}
{{@blog.description}}
website
{{@blog.url}}{{{relativeUrl}}}
{{@blog.title}}
{{@blog.url}}{{@blog.cover}}
if blog cover existsFor post and page views
{{meta_title}} — {{@blog.title}}
{{meta_description}}
if exists meta description. Else{{excerpt words="27"}}…
article
(generated by{{ghost_head}}
){{ghost_head}}
){{ghost_head}}
){{@blog.url}}{{image}}
if post have meta image. Else{{@blog.url}}{{@blog.cover}}
if blog cover exists