1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 09:13:19 +01:00

move typekit id to env var

This commit is contained in:
Matthias Kretschmann 2021-09-12 23:16:30 +02:00
parent 3b62ddc121
commit 85667902af
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 5 additions and 12 deletions

View File

@ -1 +1,2 @@
GATSBY_GITHUB_TOKEN=xxx GATSBY_GITHUB_TOKEN=xxx
GATSBY_TYPEKIT_ID=xxx

View File

@ -13,8 +13,6 @@
addressbook: /matthias-kretschmann.vcf addressbook: /matthias-kretschmann.vcf
bugs: https://github.com/kremalicious/portfolio/issues/new bugs: https://github.com/kremalicious/portfolio/issues/new
typekitID: dtg3zui
# Analytics tools # Analytics tools
matomoUrl: https://analytics.kremalicious.com matomoUrl: https://analytics.kremalicious.com
matomoSite: 2 matomoSite: 2

View File

@ -5,7 +5,7 @@
padding: calc(var(--spacer) / 3); padding: calc(var(--spacer) / 3);
font-size: var(--font-size-small); font-size: var(--font-size-small);
font-weight: bold; font-weight: bold;
background: var(--brand-light); background: var(--box-background-color);
} }
.hostnameInfo p { .hostnameInfo p {

View File

@ -1,13 +1,12 @@
import React from 'react' import React from 'react'
import { Helmet } from 'react-helmet' import { Helmet } from 'react-helmet'
import { useMeta } from '../../hooks/use-meta'
const TypekitScript = (typekitID) => ( const TypekitScript = () => (
<script> <script>
{` {`
(function(d) { (function(d) {
var config = { var config = {
kitId: '${typekitID}', kitId: '${process.env.GATSBY_TYPEKIT_ID}',
scriptTimeout: 3000, scriptTimeout: 3000,
async: true async: true
}, },
@ -18,13 +17,10 @@ const TypekitScript = (typekitID) => (
) )
export default function Typekit() { export default function Typekit() {
const { typekitID } = useMeta()
return ( return (
<Helmet> <Helmet>
<link rel="preconnect" href="https://use.typekit.net" /> <link rel="preconnect" href="https://use.typekit.net" />
<TypekitScript />
{TypekitScript(typekitID)}
</Helmet> </Helmet>
) )
} }

View File

@ -18,7 +18,6 @@ const query = graphql`
} }
gpg gpg
addressbook addressbook
typekitID
matomoUrl matomoUrl
matomoSite matomoSite
allowedHosts allowedHosts

View File

@ -19,7 +19,6 @@
"gpg": "https://kretschmann.io/pub.gpg", "gpg": "https://kretschmann.io/pub.gpg",
"addressbook": "/matthias-kretschmann.vcf", "addressbook": "/matthias-kretschmann.vcf",
"bugs": "https://github.com/kremalicious/portfolio/issues", "bugs": "https://github.com/kremalicious/portfolio/issues",
"typekitID": "dtg3zui",
"matomoUrl": "https://analytics.kremalicious.com", "matomoUrl": "https://analytics.kremalicious.com",
"matomoSite": 2, "matomoSite": 2,
"allowedHosts": [ "allowedHosts": [