1
0
mirror of https://github.com/kremalicious/ipfs.git synced 2024-11-21 17:27:06 +01:00

move typekit id to env var

This commit is contained in:
Matthias Kretschmann 2021-09-12 23:28:40 +02:00
parent 084e7a4572
commit 40d6560450
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 9 additions and 6 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
NEXT_PUBLIC_TYPEKIT_ID=msu4qap

1
.env.sample Normal file
View File

@ -0,0 +1 @@
NEXT_PUBLIC_TYPEKIT_ID=xxx

View File

@ -27,3 +27,5 @@ jobs:
- run: npm ci
- run: npm test
- run: npm run build
env:
NEXT_PUBLIC_TYPEKIT_ID: ${{ secrets.NEXT_PUBLIC_TYPEKIT_ID }}

View File

@ -19,6 +19,7 @@ This repo holds a React app built with [Next.js](https://nextjs.org) serving as
```bash
npm i
cp .env.sample .env
npm start
```

View File

@ -3,6 +3,5 @@ module.exports = {
description: 'A public IPFS Gateway',
url: 'https://ipfs.kretschmann.io',
ipfsGateway: 'https://ipfs.kretschmann.io',
ipfsNodeUri: 'https://ipfs.kretschmann.io:443',
typekitId: 'msu4qap'
ipfsNodeUri: 'https://ipfs.kretschmann.io:443'
}

View File

@ -1,11 +1,10 @@
import React, { ReactElement } from 'react'
import Head from 'next/head'
import { typekitId } from '../../site.config'
const typekitScript = `
(function(d) {
var config = {
kitId: '${typekitId}',
kitId: '${process.env.NEXT_PUBLIC_TYPEKIT_ID}',
scriptTimeout: 3000,
async: true
},
@ -14,11 +13,11 @@ const typekitScript = `
`
export default function Typekit(): ReactElement | null {
return typekitId ? (
return (
<Head key="typekit">
<link rel="dns-prefetch" href="https://use.typekit.net/" />
<link rel="dns-prefetch" href="https://p.typekit.net/" />
<script dangerouslySetInnerHTML={{ __html: typekitScript }} />
</Head>
) : null
)
}