This commit is contained in:
@@ -11,7 +11,7 @@ const collection = "resources/Recipes";
|
|||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const recipes = await memorium.listResource("Recipes");
|
const recipes = await memorium.listResource("Recipes");
|
||||||
|
|
||||||
const paths = recipes.content.filter(res =>res.content).map((recipe: any) => {
|
const paths = recipes.content?.filter(res =>res.content).map((recipe: any) => {
|
||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
recipeName: recipe.name.replace(/\.md$/, ""),
|
recipeName: recipe.name.replace(/\.md$/, ""),
|
||||||
@@ -19,7 +19,7 @@ export async function getStaticPaths() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
return paths;
|
return paths ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const recipeResponse = await memorium.listResource(
|
const recipeResponse = await memorium.listResource(
|
||||||
|
@@ -9,7 +9,7 @@ const recipes = await memorium.listResource("Recipes");
|
|||||||
<Layout title="Max Richter">
|
<Layout title="Max Richter">
|
||||||
{
|
{
|
||||||
recipes.content
|
recipes.content
|
||||||
.filter((res) => res.content)
|
?.filter((res) => res.content)
|
||||||
.map((recipe: any) => (
|
.map((recipe: any) => (
|
||||||
<HeroCard
|
<HeroCard
|
||||||
post={{
|
post={{
|
||||||
|
Reference in New Issue
Block a user