1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-22 01:03:37 +01:00

move typekit id to env var

This commit is contained in:
Matthias Kretschmann 2021-09-12 23:21:47 +02:00
parent 5776238b6a
commit 7b6c9dddb8
Signed by: m
GPG Key ID: 606EEEF3C479A91F
7 changed files with 11 additions and 18 deletions

View File

@ -1,2 +1,3 @@
GATSBY_GITHUB_TOKEN=your_token
GATSBY_MAPBOX_ACCESS_TOKEN=
GATSBY_MAPBOX_ACCESS_TOKEN=
GATSBY_TYPEKIT_ID=xxx

View File

@ -77,6 +77,7 @@ jobs:
- run: npm run build
env:
GATSBY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GATSBY_TYPEKIT_ID: ${{ secrets.GATSBY_TYPEKIT_ID }}
GATSBY_MAPBOX_ACCESS_TOKEN: ${{ secrets.GATSBY_MAPBOX_ACCESS_TOKEN }}
- uses: actions/upload-artifact@v1

View File

@ -18,7 +18,6 @@ module.exports = {
},
rss: '/feed.xml',
jsonfeed: '/feed.json',
typekitID: 'msu4qap',
itemsPerPage: 24,
repoContentPath: 'https://github.com/kremalicious/blog/tree/main/content',
menu: [

View File

@ -15,7 +15,6 @@
"bitcoin": "171qDmKEXm9YBgBLXyGjjPvopP5o9htQ1V",
"ether": "0x339dbC44d39bf1961E385ed0Ae88FC6069b87Ea1"
},
"typekitID": "msu4qap",
"menu": [
{
"title": "Photos",

View File

@ -20,7 +20,6 @@ export interface Site {
siteDescription: string
siteUrl: string
author: Author
typekitID: string
menu: MenuItem[]
rss: string
jsonfeed: string

View File

@ -1,13 +1,12 @@
import React, { ReactElement } from 'react'
import React from 'react'
import { Helmet } from 'react-helmet'
import { useSiteMetadata } from '../../hooks/use-site-metadata'
const TypekitScript = (typekitID: string) => (
const TypekitScript = () => (
<script>
{`
(function(d) {
var config = {
kitId: '${typekitID}',
kitId: '${process.env.GATSBY_TYPEKIT_ID}',
scriptTimeout: 3000,
async: true
},
@ -17,15 +16,11 @@ const TypekitScript = (typekitID: string) => (
</script>
)
export default function Typekit(): ReactElement {
const { typekitID } = useSiteMetadata()
return typekitID ? (
export default function Typekit(): JSX.Element {
return (
<Helmet>
<link rel="dns-prefetch" href="https://use.typekit.net/" />
<link rel="dns-prefetch" href="https://p.typekit.net/" />
{TypekitScript(typekitID)}
<link rel="preconnect" href="https://use.typekit.net" />
<TypekitScript />
</Helmet>
) : null
)
}

View File

@ -19,7 +19,6 @@ const query = graphql`
bitcoin
ether
}
typekitID
menu {
title
link