Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pettinarip committed Sep 12, 2022
1 parent 5085264 commit 7848526
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 7 additions & 1 deletion gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ const config: GatsbyConfig = {
}
}
}`,
resolvePages: ({ site, allSitePage: { nodes: allPages } }) => {
resolvePages: ({
site,
allSitePage: { nodes: allPages },
}: {
site: { siteMetadata: { siteUrl: string } }
allSitePage: { nodes: Array<{ path: string }> }
}) => {
return allPages
.filter((page) => {
// Filter out 404 pages
Expand Down
6 changes: 5 additions & 1 deletion gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ const checkIsMdxOutdated = (filePath: string): boolean => {
let englishMatch = ""
let intlMatch = ""
try {
// @ts-ignore
englishData.match(re).forEach((match) => {
englishMatch += match.replace(re, (_, p1, p2) => p1 + p2)
})
// @ts-ignore
translatedData.match(re).forEach((match) => {
intlMatch += match.replace(re, (_, p1, p2) => p1 + p2)
})
Expand Down Expand Up @@ -443,7 +445,9 @@ export const createSchemaCustomization: GatsbyNode["createSchemaCustomization"]
const { createTypes } = actions
const { sdls } = Schema

createTypes([...Object.keys(sdls).map((sdlKey) => sdls[sdlKey])])
createTypes([
...Object.keys(sdls).map((sdlKey) => sdls[sdlKey as keyof typeof sdls]),
])
}

export const onPreBootstrap: GatsbyNode["onPreBootstrap"] = ({ reporter }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/layer-2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ const Layer2Page = ({ data }: PageProps<Queries.Layer2PageQuery>) => {
<Layer2ProductCard
key={idx}
background={l2.background}
image={getImage(data[l2.imageKey])!}
image={getImage(data[l2.imageKey as keyof typeof data])!}
description={translateMessageId(
l2.descriptionKey as TranslationKey,
intl
Expand Down Expand Up @@ -752,7 +752,7 @@ const Layer2Page = ({ data }: PageProps<Queries.Layer2PageQuery>) => {
<Layer2ProductCard
key={idx}
background={l2.background}
image={getImage(data[l2.imageKey])!}
image={getImage(data[l2.imageKey as keyof typeof data])!}
description={translateMessageId(
l2.descriptionKey as TranslationKey,
intl
Expand Down

0 comments on commit 7848526

Please sign in to comment.