mirror of
https://github.com/kremalicious/ipfs.git
synced 2024-12-26 14:47:48 +01:00
move typekit id to env var
This commit is contained in:
parent
084e7a4572
commit
40d6560450
1
.env.sample
Normal file
1
.env.sample
Normal file
@ -0,0 +1 @@
|
||||
NEXT_PUBLIC_TYPEKIT_ID=xxx
|
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -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 }}
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
|
@ -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'
|
||||
}
|
||||
|
@ -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
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user