make routing fixes from discord feedback (#1091)

This commit is contained in:
Fred K. Schott 2021-08-12 01:35:28 -07:00 committed by GitHub
parent 34e9ab8b10
commit dcb97b0223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 448 additions and 443 deletions

View file

@ -91,7 +91,7 @@
"semver": "^7.3.5",
"shorthash": "^0.0.2",
"slash": "^4.0.0",
"snowpack": "^3.8.3",
"snowpack": "^3.8.6",
"string-width": "^5.0.0",
"supports-esm": "^1.0.0",
"tiny-glob": "^0.2.8",

View file

@ -32,12 +32,12 @@ export async function getStaticPathsForPage({
const mod = await snowpackRuntime.importModule(location.snowpackURL);
validateGetStaticPathsModule(mod);
const [rssFunction, rssResult] = generateRssFunction(astroConfig.buildOptions.site, route);
const staticPaths: GetStaticPathsResult = await mod.exports
.getStaticPaths({
const staticPaths: GetStaticPathsResult = (
await mod.exports.getStaticPaths({
paginate: generatePaginateFunction(route),
rss: rssFunction,
})
.flat();
).flat();
validateGetStaticPathsResult(staticPaths, logging);
return {
paths: staticPaths.map((staticPath) => staticPath.params && route.generate(staticPath.params)).filter(Boolean),

View file

@ -1,5 +1,5 @@
---
export function getStaticPaths({paginate}) {
export async function getStaticPaths({paginate}) {
const data = Astro.fetchContent('../../post/*.md');
return paginate(data, {pageSize: 1});
}

View file

@ -1,5 +1,5 @@
---
export function getStaticPaths({paginate}) {
export async function getStaticPaths({paginate}) {
const data = Astro.fetchContent('../../post/*.md');
return paginate(data, {pageSize: 1});
}

879
yarn.lock

File diff suppressed because it is too large Load diff