make routing fixes from discord feedback (#1091)
This commit is contained in:
parent
34e9ab8b10
commit
dcb97b0223
5 changed files with 448 additions and 443 deletions
|
@ -91,7 +91,7 @@
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.5",
|
||||||
"shorthash": "^0.0.2",
|
"shorthash": "^0.0.2",
|
||||||
"slash": "^4.0.0",
|
"slash": "^4.0.0",
|
||||||
"snowpack": "^3.8.3",
|
"snowpack": "^3.8.6",
|
||||||
"string-width": "^5.0.0",
|
"string-width": "^5.0.0",
|
||||||
"supports-esm": "^1.0.0",
|
"supports-esm": "^1.0.0",
|
||||||
"tiny-glob": "^0.2.8",
|
"tiny-glob": "^0.2.8",
|
||||||
|
|
|
@ -32,12 +32,12 @@ export async function getStaticPathsForPage({
|
||||||
const mod = await snowpackRuntime.importModule(location.snowpackURL);
|
const mod = await snowpackRuntime.importModule(location.snowpackURL);
|
||||||
validateGetStaticPathsModule(mod);
|
validateGetStaticPathsModule(mod);
|
||||||
const [rssFunction, rssResult] = generateRssFunction(astroConfig.buildOptions.site, route);
|
const [rssFunction, rssResult] = generateRssFunction(astroConfig.buildOptions.site, route);
|
||||||
const staticPaths: GetStaticPathsResult = await mod.exports
|
const staticPaths: GetStaticPathsResult = (
|
||||||
.getStaticPaths({
|
await mod.exports.getStaticPaths({
|
||||||
paginate: generatePaginateFunction(route),
|
paginate: generatePaginateFunction(route),
|
||||||
rss: rssFunction,
|
rss: rssFunction,
|
||||||
})
|
})
|
||||||
.flat();
|
).flat();
|
||||||
validateGetStaticPathsResult(staticPaths, logging);
|
validateGetStaticPathsResult(staticPaths, logging);
|
||||||
return {
|
return {
|
||||||
paths: staticPaths.map((staticPath) => staticPath.params && route.generate(staticPath.params)).filter(Boolean),
|
paths: staticPaths.map((staticPath) => staticPath.params && route.generate(staticPath.params)).filter(Boolean),
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
export function getStaticPaths({paginate}) {
|
export async function getStaticPaths({paginate}) {
|
||||||
const data = Astro.fetchContent('../../post/*.md');
|
const data = Astro.fetchContent('../../post/*.md');
|
||||||
return paginate(data, {pageSize: 1});
|
return paginate(data, {pageSize: 1});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
export function getStaticPaths({paginate}) {
|
export async function getStaticPaths({paginate}) {
|
||||||
const data = Astro.fetchContent('../../post/*.md');
|
const data = Astro.fetchContent('../../post/*.md');
|
||||||
return paginate(data, {pageSize: 1});
|
return paginate(data, {pageSize: 1});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue