Created
September 16, 2020 19:46
-
-
Save garethredfern/b79c3f95ceb82f213e2d68ce7b5fae5b to your computer and use it in GitHub Desktop.
The full getSiteMeta function for a Nuxt website, including social media and SEO tags.
This file contains hidden or 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
const type = "website"; | |
const url = "https://bobross.com"; | |
const title = "My Amazing Blog on The Joy of Painting"; | |
const description = "Articles focused on the beautiful art of landscape painting."; | |
const mainImage = "/a-lovely-image.png"; | |
export default (meta) => { | |
return [ | |
{ | |
hid: "description", | |
name: "description", | |
content: (meta && meta.description) || description, | |
}, | |
{ | |
hid: "og:type", | |
property: "og:type", | |
content: (meta && meta.type) || type, | |
}, | |
{ | |
hid: "og:url", | |
property: "og:url", | |
content: (meta && meta.url) || url, | |
}, | |
{ | |
hid: "og:title", | |
property: "og:title", | |
content: (meta && meta.title) || title, | |
}, | |
{ | |
hid: "og:description", | |
property: "og:description", | |
content: (meta && meta.description) || description, | |
}, | |
{ | |
hid: "og:image", | |
property: "og:image", | |
content: (meta && meta.mainImage) || mainImage, | |
}, | |
{ | |
hid: "twitter:url", | |
name: "twitter:url", | |
content: (meta && meta.url) || url, | |
}, | |
{ | |
hid: "twitter:title", | |
name: "twitter:title", | |
content: (meta && meta.title) || title, | |
}, | |
{ | |
hid: "twitter:description", | |
name: "twitter:description", | |
content: (meta && meta.description) || description, | |
}, | |
{ | |
hid: "twitter:image", | |
name: "twitter:image", | |
content: (meta && meta.mainImage) || mainImage, | |
}, | |
]; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment