Created
July 26, 2020 12:14
-
-
Save lockevn/37d908e075d17a008e6e3bc267360029 to your computer and use it in GitHub Desktop.
Inject an inline JavaScript in to head of page rendered by Nuxt
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
/** | |
* All of these can be overrided in each page component via define method https://nuxtjs.org/api/pages-head/ | |
* E.g.: head() { return { title: "", meta: [] } } | |
*/ | |
export default { | |
titleTemplate: "%s - " + _WhiteLabel.brandname, | |
title: "Shop", | |
meta: [ | |
{ "http-equiv": "utf-8" }, | |
{ charset: "X-UA-Compatible", content: "IE=edge" }, | |
{ name: "viewport", content: "width=device-width, initial-scale=1" }, | |
{ hid: "keywords", name: "keywords", content: _WhiteLabel.keywords }, | |
{ hid: "description", name: "description", content: _WhiteLabel.description }, | |
], | |
link: [ | |
{ rel: "icon", type: "image/x-icon", href: `${process.env.WHITELABEL_CODE}/images/favicon.png` } | |
], | |
__dangerouslyDisableSanitizers: ["script"], | |
script: [{ innerHTML: `var process = process || { env: {WHITELABEL_CODE : "${process.env.WHITELABEL_CODE}"}};console.log(process.env);`, type: "text/javascript", charset: "utf-8" }] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment