From 7b6c9dddb8f2a852e5143f1697246039768ecd73 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 12 Sep 2021 23:21:47 +0200 Subject: [PATCH] move typekit id to env var --- .env.sample | 3 ++- .github/workflows/ci.yml | 1 + config.js | 1 - jest/__fixtures__/meta.json | 1 - src/@types/Site.d.ts | 1 - src/components/atoms/Typekit.tsx | 21 ++++++++------------- src/hooks/use-site-metadata.ts | 1 - 7 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.env.sample b/.env.sample index 0c4037eb..3ea5f533 100644 --- a/.env.sample +++ b/.env.sample @@ -1,2 +1,3 @@ GATSBY_GITHUB_TOKEN=your_token -GATSBY_MAPBOX_ACCESS_TOKEN= \ No newline at end of file +GATSBY_MAPBOX_ACCESS_TOKEN= +GATSBY_TYPEKIT_ID=xxx \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3555ee5..59977c52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/config.js b/config.js index 4b0caf73..bcc4c75b 100644 --- a/config.js +++ b/config.js @@ -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: [ diff --git a/jest/__fixtures__/meta.json b/jest/__fixtures__/meta.json index 5f9e23f3..6a102971 100644 --- a/jest/__fixtures__/meta.json +++ b/jest/__fixtures__/meta.json @@ -15,7 +15,6 @@ "bitcoin": "171qDmKEXm9YBgBLXyGjjPvopP5o9htQ1V", "ether": "0x339dbC44d39bf1961E385ed0Ae88FC6069b87Ea1" }, - "typekitID": "msu4qap", "menu": [ { "title": "Photos", diff --git a/src/@types/Site.d.ts b/src/@types/Site.d.ts index 941d8788..c1db4bfa 100644 --- a/src/@types/Site.d.ts +++ b/src/@types/Site.d.ts @@ -20,7 +20,6 @@ export interface Site { siteDescription: string siteUrl: string author: Author - typekitID: string menu: MenuItem[] rss: string jsonfeed: string diff --git a/src/components/atoms/Typekit.tsx b/src/components/atoms/Typekit.tsx index 27cacea7..b6de513d 100644 --- a/src/components/atoms/Typekit.tsx +++ b/src/components/atoms/Typekit.tsx @@ -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 = () => ( ) -export default function Typekit(): ReactElement { - const { typekitID } = useSiteMetadata() - - return typekitID ? ( +export default function Typekit(): JSX.Element { + return ( - - - - {TypekitScript(typekitID)} + + - ) : null + ) } diff --git a/src/hooks/use-site-metadata.ts b/src/hooks/use-site-metadata.ts index 4ebdff53..6f8596b7 100644 --- a/src/hooks/use-site-metadata.ts +++ b/src/hooks/use-site-metadata.ts @@ -19,7 +19,6 @@ const query = graphql` bitcoin ether } - typekitID menu { title link