Skip to content

Commit

Permalink
fix(gatsby-node): add missing slug on fixed pages that are not the index
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn authored Sep 16, 2021
1 parent 78c46f7 commit 81eb4c5
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
56 changes: 54 additions & 2 deletions examples/my-gatsby-site/jaen-pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,65 @@
},
"SitePage /3ab722c8-db8f-41b9-8277-badbf0ad3261": {
"context": {
"fileUrl": "https://cloudflare-ipfs.com/ipfs/Qmb9MsnbuMH3Kynn6191p7zPa7BZ26sbwTVjuJvvNhkmme",
"createdAt": "2021-09-11T23:12:46.731Z"
"createdAt": "2021-09-16T03:36:18.858Z",
"fileUrl": "https://cloudflare-ipfs.com/ipfs/QmYjn9Kgkv85YpMgrzMfjAoTDXaNkdu7dhgDHGTiXSvkyF"
},
"migrations": [
{
"fileUrl": "https://cloudflare-ipfs.com/ipfs/Qmb9MsnbuMH3Kynn6191p7zPa7BZ26sbwTVjuJvvNhkmme",
"createdAt": "2021-09-11T23:12:46.731Z"
},
{
"fileUrl": "https://cloudflare-ipfs.com/ipfs/QmQe7YuL8M2QMcfPbRcDhDuGXVyGgUGU5fmnFQ49jzXsgN",
"createdAt": "2021-09-16T03:36:18.858Z"
}
]
},
"SitePage /876b413b-7f3d-408e-9674-ecf57f65dad3": {
"context": {
"fileUrl": "https://cloudflare-ipfs.com/ipfs/QmXCwJtbYi1WSwZM8aGzyaEuLpwZ38Fv4WJwW4ii94B6re",
"createdAt": "2021-09-16T03:36:18.858Z"
},
"migrations": [
{
"fileUrl": "https://cloudflare-ipfs.com/ipfs/QmXCwJtbYi1WSwZM8aGzyaEuLpwZ38Fv4WJwW4ii94B6re",
"createdAt": "2021-09-16T03:36:18.858Z"
}
]
},
"SitePage /580d1d1c-61c1-4454-aa38-acb4ce83ac4d": {
"context": {
"fileUrl": "https://cloudflare-ipfs.com/ipfs/Qma4i8rrAc9wbEJc5GGqeuEWhxVU67WAi9ykv6tQev4X4C",
"createdAt": "2021-09-16T03:36:18.858Z"
},
"migrations": [
{
"fileUrl": "https://cloudflare-ipfs.com/ipfs/Qma4i8rrAc9wbEJc5GGqeuEWhxVU67WAi9ykv6tQev4X4C",
"createdAt": "2021-09-16T03:36:18.858Z"
}
]
},
"SitePage /cbf6930d-cb91-4dd9-a306-0ca075b7e0df": {
"context": {
"fileUrl": "https://cloudflare-ipfs.com/ipfs/QmUSCni8VUmuVbC6FnXnLmoyZNmmth6CHyefTMbGM1dYWr",
"createdAt": "2021-09-16T03:45:02.787Z"
},
"migrations": [
{
"fileUrl": "https://cloudflare-ipfs.com/ipfs/QmUSCni8VUmuVbC6FnXnLmoyZNmmth6CHyefTMbGM1dYWr",
"createdAt": "2021-09-16T03:45:02.787Z"
}
]
},
"SitePage /testpage/": {
"context": {
"fileUrl": "https://cloudflare-ipfs.com/ipfs/QmQ3Rbs4rq3wXqNT9wwR2QbQu7EgDn1KaHtTSQuZV9j3Eh",
"createdAt": "2021-09-16T03:45:02.787Z"
},
"migrations": [
{
"fileUrl": "https://cloudflare-ipfs.com/ipfs/QmQ3Rbs4rq3wXqNT9wwR2QbQu7EgDn1KaHtTSQuZV9j3Eh",
"createdAt": "2021-09-16T03:45:02.787Z"
}
]
}
Expand Down
3 changes: 3 additions & 0 deletions examples/my-gatsby-site/src/pages/testpage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function TestPage() {
return null
}
4 changes: 3 additions & 1 deletion packages/jaen-pages/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ exports.onCreatePage = async ({
...page.context,
jaenPageContext: {
id,
slug,
...cachedJaenPage,
slug: cachedJaenPage?.slug || slug,
pageMetadata: {
title: internalComponentName,
datePublished: new Date().toISOString(),
Expand All @@ -188,6 +188,8 @@ exports.onCreatePage = async ({
}
}

console.log(newPage)

createPage(newPage)
}
}

0 comments on commit 81eb4c5

Please sign in to comment.