mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-22 17:23:50 +01:00
move typekit id to env var
This commit is contained in:
parent
5776238b6a
commit
7b6c9dddb8
@ -1,2 +1,3 @@
|
|||||||
GATSBY_GITHUB_TOKEN=your_token
|
GATSBY_GITHUB_TOKEN=your_token
|
||||||
GATSBY_MAPBOX_ACCESS_TOKEN=
|
GATSBY_MAPBOX_ACCESS_TOKEN=
|
||||||
|
GATSBY_TYPEKIT_ID=xxx
|
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -77,6 +77,7 @@ jobs:
|
|||||||
- run: npm run build
|
- run: npm run build
|
||||||
env:
|
env:
|
||||||
GATSBY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GATSBY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GATSBY_TYPEKIT_ID: ${{ secrets.GATSBY_TYPEKIT_ID }}
|
||||||
GATSBY_MAPBOX_ACCESS_TOKEN: ${{ secrets.GATSBY_MAPBOX_ACCESS_TOKEN }}
|
GATSBY_MAPBOX_ACCESS_TOKEN: ${{ secrets.GATSBY_MAPBOX_ACCESS_TOKEN }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
|
@ -18,7 +18,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
rss: '/feed.xml',
|
rss: '/feed.xml',
|
||||||
jsonfeed: '/feed.json',
|
jsonfeed: '/feed.json',
|
||||||
typekitID: 'msu4qap',
|
|
||||||
itemsPerPage: 24,
|
itemsPerPage: 24,
|
||||||
repoContentPath: 'https://github.com/kremalicious/blog/tree/main/content',
|
repoContentPath: 'https://github.com/kremalicious/blog/tree/main/content',
|
||||||
menu: [
|
menu: [
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
"bitcoin": "171qDmKEXm9YBgBLXyGjjPvopP5o9htQ1V",
|
"bitcoin": "171qDmKEXm9YBgBLXyGjjPvopP5o9htQ1V",
|
||||||
"ether": "0x339dbC44d39bf1961E385ed0Ae88FC6069b87Ea1"
|
"ether": "0x339dbC44d39bf1961E385ed0Ae88FC6069b87Ea1"
|
||||||
},
|
},
|
||||||
"typekitID": "msu4qap",
|
|
||||||
"menu": [
|
"menu": [
|
||||||
{
|
{
|
||||||
"title": "Photos",
|
"title": "Photos",
|
||||||
|
1
src/@types/Site.d.ts
vendored
1
src/@types/Site.d.ts
vendored
@ -20,7 +20,6 @@ export interface Site {
|
|||||||
siteDescription: string
|
siteDescription: string
|
||||||
siteUrl: string
|
siteUrl: string
|
||||||
author: Author
|
author: Author
|
||||||
typekitID: string
|
|
||||||
menu: MenuItem[]
|
menu: MenuItem[]
|
||||||
rss: string
|
rss: string
|
||||||
jsonfeed: string
|
jsonfeed: string
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React from 'react'
|
||||||
import { Helmet } from 'react-helmet'
|
import { Helmet } from 'react-helmet'
|
||||||
import { useSiteMetadata } from '../../hooks/use-site-metadata'
|
|
||||||
|
|
||||||
const TypekitScript = (typekitID: string) => (
|
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
|
||||||
},
|
},
|
||||||
@ -17,15 +16,11 @@ const TypekitScript = (typekitID: string) => (
|
|||||||
</script>
|
</script>
|
||||||
)
|
)
|
||||||
|
|
||||||
export default function Typekit(): ReactElement {
|
export default function Typekit(): JSX.Element {
|
||||||
const { typekitID } = useSiteMetadata()
|
return (
|
||||||
|
|
||||||
return typekitID ? (
|
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<link rel="dns-prefetch" href="https://use.typekit.net/" />
|
<link rel="preconnect" href="https://use.typekit.net" />
|
||||||
<link rel="dns-prefetch" href="https://p.typekit.net/" />
|
<TypekitScript />
|
||||||
|
|
||||||
{TypekitScript(typekitID)}
|
|
||||||
</Helmet>
|
</Helmet>
|
||||||
) : null
|
)
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ const query = graphql`
|
|||||||
bitcoin
|
bitcoin
|
||||||
ether
|
ether
|
||||||
}
|
}
|
||||||
typekitID
|
|
||||||
menu {
|
menu {
|
||||||
title
|
title
|
||||||
link
|
link
|
||||||
|
Loading…
Reference in New Issue
Block a user