Skip to content

Commit

Permalink
Fix broken builds for netlify and patch fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-t-james committed Nov 30, 2020
1 parent df38961 commit bd7cb03
Show file tree
Hide file tree
Showing 7 changed files with 1,575 additions and 2,272 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [10.x]
node-version: [12.x, 14.x, 15.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -27,4 +27,4 @@ jobs:
- run: yarn test

env:
CI: true
CI: true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.16.0
14
1 change: 1 addition & 0 deletions font-preload-cache.json

Large diffs are not rendered by default.

33 changes: 18 additions & 15 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,26 @@ const gatsbyConfig = {
logo: `${__dirname}/src/images/favicon.png`,
},
},
`gatsby-plugin-preload-fonts`,
{
resolve: `gatsby-plugin-prefetch-google-fonts`,
resolve: `gatsby-plugin-webfonts`,
options: {
fonts: [
{
family: `Roboto Slab`,
variants: [`100`, `300`, `400`, `700`],
},
{
family: `Open Sans`,
variants: [`300`, `300i`, `400`, `400i`, `800`],
},
{
family: `Lato`,
variants: [`300`, `400`, `700`, `900`],
},
],
fonts: {
google: [
{
family: `Roboto Slab`,
variants: [`100`, `300`, `400`, `700`],
},
{
family: `Open Sans`,
variants: [`300`, `300i`, `400`, `400i`, `800`],
},
{
family: `Lato`,
variants: [`300`, `400`, `700`, `900`],
},
],
},
},
},
],
Expand Down
4 changes: 2 additions & 2 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const React = require('react')
const Layout = require('./src/components/Layout').default

exports.onRenderBody = ({ setPostBodyComponents, setPreBodyComponents }) => {
setPreBodyComponents(<MagicScriptTag />)
setPreBodyComponents(<MagicScriptTag key="magic-script-tag" />)
setPostBodyComponents([
<script key="https://linked.chat/web/a9LB63" src="https://linked.chat/web/a9LB63" defer />,
])
Expand Down Expand Up @@ -38,5 +38,5 @@ const MagicScriptTag = () => {
root.setAttribute("color-mode", colorMode === "light" ? "light" : "dark")
})()`
// eslint-disable-next-line react/no-danger
return <script key="magic-script-tag" dangerouslySetInnerHTML={{ __html: codeToRunOnClient }} />
return <script dangerouslySetInnerHTML={{ __html: codeToRunOnClient }} />
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"repository": "Vets-Who-Code/vwc-site",
"dependencies": {
"@contentful/rich-text-react-renderer": "14.1.1",
"@hot-loader/react-dom": "17.0.0",
"babel-preset-gatsby": "0.5.14",
"dotenv": "8.2.0",
Expand All @@ -14,9 +15,11 @@
"gatsby-plugin-favicon": "3.1.6",
"gatsby-plugin-gtag": "^1.0.13",
"gatsby-plugin-mailchimp": "5.2.2",
"gatsby-plugin-prefetch-google-fonts": "1.4.3",
"gatsby-plugin-preload-fonts": "1.4.0",
"gatsby-plugin-react-helmet": "3.3.14",
"gatsby-plugin-sharp": "2.6.43",
"gatsby-plugin-webfonts": "1.1.3",
"gatsby-source-contentful": "3.0.3",
"gatsby-source-filesystem": "2.3.35",
"gatsby-transformer-sharp": "2.5.19",
"generate": "0.14.0",
Expand Down Expand Up @@ -46,6 +49,7 @@
"build": "gatsby build",
"build:prod": "yarn enable:contentful && yarn && gatsby build",
"clean": "gatsby clean",
"preload-fonts": "gatsby-preload-fonts",
"develop": "node ./scripts/pre-start",
"disable:contentful": "node -e 'require(\"./scripts/disable-contentful-modules.js\").resetConfig()'",
"enable:contentful": "node -e 'require(\"./scripts/enable-contentful-modules.js\").enableContentfulContent()'",
Expand Down
Loading

0 comments on commit bd7cb03

Please sign in to comment.