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:
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 ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
- run: npm run build
|
- 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
|
```bash
|
||||||
npm i
|
npm i
|
||||||
|
cp .env.sample .env
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -3,6 +3,5 @@ module.exports = {
|
|||||||
description: 'A public IPFS Gateway',
|
description: 'A public IPFS Gateway',
|
||||||
url: 'https://ipfs.kretschmann.io',
|
url: 'https://ipfs.kretschmann.io',
|
||||||
ipfsGateway: 'https://ipfs.kretschmann.io',
|
ipfsGateway: 'https://ipfs.kretschmann.io',
|
||||||
ipfsNodeUri: 'https://ipfs.kretschmann.io:443',
|
ipfsNodeUri: 'https://ipfs.kretschmann.io:443'
|
||||||
typekitId: 'msu4qap'
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import React, { ReactElement } from 'react'
|
import React, { ReactElement } from 'react'
|
||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
import { typekitId } from '../../site.config'
|
|
||||||
|
|
||||||
const typekitScript = `
|
const typekitScript = `
|
||||||
(function(d) {
|
(function(d) {
|
||||||
var config = {
|
var config = {
|
||||||
kitId: '${typekitId}',
|
kitId: '${process.env.NEXT_PUBLIC_TYPEKIT_ID}',
|
||||||
scriptTimeout: 3000,
|
scriptTimeout: 3000,
|
||||||
async: true
|
async: true
|
||||||
},
|
},
|
||||||
@ -14,11 +13,11 @@ const typekitScript = `
|
|||||||
`
|
`
|
||||||
|
|
||||||
export default function Typekit(): ReactElement | null {
|
export default function Typekit(): ReactElement | null {
|
||||||
return typekitId ? (
|
return (
|
||||||
<Head key="typekit">
|
<Head key="typekit">
|
||||||
<link rel="dns-prefetch" href="https://use.typekit.net/" />
|
<link rel="dns-prefetch" href="https://use.typekit.net/" />
|
||||||
<link rel="dns-prefetch" href="https://p.typekit.net/" />
|
<link rel="dns-prefetch" href="https://p.typekit.net/" />
|
||||||
<script dangerouslySetInnerHTML={{ __html: typekitScript }} />
|
<script dangerouslySetInnerHTML={{ __html: typekitScript }} />
|
||||||
</Head>
|
</Head>
|
||||||
) : null
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user