Last active
October 20, 2021 15:25
-
-
Save aeadedoyin/f064f4ff54a37c53b98fe117249c7b6c to your computer and use it in GitHub Desktop.
Quickly scaffold for link block in html head tag of a page (VueJS or NuxtJS)
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
// Utils file can be found here https://gist.github.com/aeadedoyin/f9fb0817762bc49ad8a856cd0b16ca97 | |
// Just download and keep in same folder as this.(i.e link-utils.js) | |
import { withHttp } from './utils' | |
// This util makes it faster to implement meta:Open Graph, Twitter | |
// All these variable are overbidden if passed with meta param | |
let url = process.env.SITE_URL // From env | |
export default (meta) => { | |
url = meta && meta.url ? withHttp(meta.url) : withHttp(url) | |
return [ | |
{ | |
rel: 'icon', | |
type: 'images/png', | |
href: url + '/favicon.png' | |
}, | |
{ | |
rel: 'apple-touch-icon', | |
type: 'images/png', | |
href: url + '/webclip.png' | |
}, | |
{ | |
rel: 'stylesheet', | |
href: 'https://fonts.googleapis.com/css?family=Inter:regular,600,700,800' | |
}, | |
{ | |
hid: 'canonical', | |
rel: 'canonical', | |
href: url | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment