Last active
May 6, 2024 05:18
-
-
Save allanwhite/6576218 to your computer and use it in GitHub Desktop.
A Jade snippet for spitting out Open Graph meta tags based on a simple array. Note: various social networks have different requirements about images, etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
Hi, I just tried to compile your snippet but it keeps showing errors, have you updated to work with pug?