Skip to content

Instantly share code, notes, and snippets.

@0ex-d
Last active March 16, 2017 22:08
Show Gist options
  • Save 0ex-d/caed8f59659f3239f92256988d55250e to your computer and use it in GitHub Desktop.
Save 0ex-d/caed8f59659f3239f92256988d55250e to your computer and use it in GitHub Desktop.
Quickly Setup Open Graph(og) tags for social media optimization
<link rel="canonical" href="{page.url}" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="{page.title}" />
<meta property="og:url" content="{page.url}" />
<meta property="og:site_name" content="{site.name}" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{page.title}" />
<script type='application/ld+json'>
{
"@context": "http:\/\/schema.org",
"@type": "WebSite",
"@id": "#website",
"url": "{base.url}",
"name": "{site.name}",
"potentialAction": {
"@type": "SearchAction",
"target": "{base.url}?s={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
<!--{has_post?}-->
<link rel="canonical" href="{page.url}" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="article" />
<meta property="og:title" content="{page.title}" />
<meta property="og:description" content="~300 chars" />
<meta property="og:url" content="{page.url}" />
<meta property="og:site_name" content="{site.name}" />
<meta property="article:section" content="News" />
<meta property="article:published_time" content="{time.delta}" />
<meta property="article:modified_time" content="{time.delta}" />
<meta property="og:updated_time" content="{time.delta}" />
<meta property="og:image" content="{page.image.url}" />
<meta property="og:image:width" content="720" />
<meta property="og:image:height" content="540" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="~ 300 chars" />
<meta name="twitter:title" content="{page.title}" />
<meta name="twitter:image" content="{page.image.url}" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment