diff --git a/src/data/categories.ts b/src/data/categories.ts index 12e24a7..9af2f79 100644 --- a/src/data/categories.ts +++ b/src/data/categories.ts @@ -15,7 +15,7 @@ export interface Category { /** * URL slug for Product Category. */ - slug: string; + slug?: string; /** * Image for the category. */ @@ -55,7 +55,6 @@ export class StaticCategory { export const ALL_CATEGORIES = TreeNode.createRoot({ id: 0, category: "All Categories", - slug: "all-categories", description: "All categories in the whole store." }).addChild({ id: StaticCategory.nextId(), diff --git a/src/pages/category/[...categoryLookup].astro b/src/pages/category/[...categoryLookup].astro index 4116c4a..ababe2d 100644 --- a/src/pages/category/[...categoryLookup].astro +++ b/src/pages/category/[...categoryLookup].astro @@ -9,9 +9,9 @@ import { DeepArray } from '../../types/deep-array'; type CategoryStaticPath = { params: { categoryLookup: string }}; export function getStaticPaths() { - return ALL_CATEGORIES.getAllNodes().map(categoryNode => { return { + return ALL_CATEGORIES.getAllNodes().filter(categoryNode => categoryNode.value.slug !== undefined).map(categoryNode => { return { params: { - categoryLookup: categoryNode.value.slug + categoryLookup: categoryNode.value.slug! } }}); }