-
+
{product?.callout || category.description}
diff --git a/src/pages/brand/[brandLookup].astro b/src/pages/brand/[brandLookup].astro
index 6a25d4e..10f05ec 100644
--- a/src/pages/brand/[brandLookup].astro
+++ b/src/pages/brand/[brandLookup].astro
@@ -28,7 +28,6 @@ export function getStaticPaths() {
}
}});
}
-console.log(getStaticPaths());
const { brandLookup } = Astro.params;
const brand: Brand = ALL_BRANDS.find(b => b.slug === brandLookup)!;
diff --git a/src/pages/category/[categoryLookup].astro b/src/pages/category/[categoryLookup].astro
index e2d0135..e377762 100644
--- a/src/pages/category/[categoryLookup].astro
+++ b/src/pages/category/[categoryLookup].astro
@@ -10,14 +10,13 @@ type CategoryStaticPath = { params: { categoryLookup: string }};
export function getStaticPaths() {
return ALL_CATEGORIES.map((category) => { return {
params: {
- categoryLookup: category.seoLink
+ categoryLookup: category.slug
}
}});
}
-console.log(getStaticPaths());
const { categoryLookup } = Astro.params;
-const category = ALL_CATEGORIES.find(c => c.seoLink === categoryLookup)!;
+const category = ALL_CATEGORIES.find(c => c.slug === categoryLookup)!;
const categoryProducts = ALL_PRODUCTS.filter(p => p.categoryId === category.id)!;
---
diff --git a/src/pages/index.astro b/src/pages/index.astro
index a84bd4a..c55bac1 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -4,6 +4,7 @@ import CategoryCard from '../components/CategoryCard.astro';
import BrandCard from '../components/BrandCard.astro';
import { ALL_CATEGORIES } from '../data/categories';
import { ALL_BRANDS } from '../data/brands';
+import { getProductsForCategoryId } from '../data/products';
---
@@ -13,7 +14,7 @@ import { ALL_BRANDS } from '../data/brands';
Your one-stop shop for all your after-market Dasher supplies.
- {ALL_CATEGORIES.map(category => (
+ {ALL_CATEGORIES.filter(category => getProductsForCategoryId(category.id)?.length > 0).map(category => (
@@ -101,7 +102,7 @@ import { ALL_BRANDS } from '../data/brands';
}
.link-card-grid {
display: grid;
- grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
+ grid-template-columns: repeat(auto-fit, minmax(48ch, 1fr));
gap: 2rem;
padding: 0;
}