Skip to content

Instantly share code, notes, and snippets.

@takouhai
Forked from allanwhite/G+ metadata
Last active August 9, 2016 20:32
Show Gist options
  • Save takouhai/fda8809a7dfaa471472e2649457f13da to your computer and use it in GitHub Desktop.
Save takouhai/fda8809a7dfaa471472e2649457f13da to your computer and use it in GitHub Desktop.
Pug snippet for spitting out Open Graph meta tags based on a simple array. Note: various social networks have different requirements about images, etc.
- var site = {title: 'site name', url: 'http:site.com', image: '/images/thumbnail-site-square.jpg', favicon: '/favicon.ico', description: 'Site Description'}
each val, key in site // Open Graph metadata
meta( property = 'og:' + key , content = val )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment