diff --git a/public/assets/brands/coast.jpg b/public/assets/brands/coast.jpg new file mode 100644 index 0000000..8f14a11 --- /dev/null +++ b/public/assets/brands/coast.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b32b6721caa3d07c1e0788f0f5c521ad72e8ef0cce7636143be4d995a8cc1bb5 +size 3069 diff --git a/public/assets/brands/first-aid-only.png b/public/assets/brands/first-aid-only.png new file mode 100644 index 0000000..985cdfe --- /dev/null +++ b/public/assets/brands/first-aid-only.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66aa9b12ff98d2c993cd6bb3ec0d51805cc5731c4df32cdf7bb3dd0b23ac827d +size 1246 diff --git a/public/assets/brands/rubbermaid.svg b/public/assets/brands/rubbermaid.svg new file mode 100644 index 0000000..8ae8a8a --- /dev/null +++ b/public/assets/brands/rubbermaid.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/public/assets/brands/vortex-optics.svg b/public/assets/brands/vortex-optics.svg new file mode 100644 index 0000000..e700f74 --- /dev/null +++ b/public/assets/brands/vortex-optics.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/components/BrandCard.astro b/src/components/BrandCard.astro new file mode 100644 index 0000000..01d2157 --- /dev/null +++ b/src/components/BrandCard.astro @@ -0,0 +1,59 @@ +--- +import type { Brand } from '../data/brands/brand'; + +interface Props { + brand: Brand +} + +const { brand } = Astro.props; +--- + + + diff --git a/src/components/ProductCard.astro b/src/components/ProductCard.astro index c876fa3..f886896 100644 --- a/src/components/ProductCard.astro +++ b/src/components/ProductCard.astro @@ -10,21 +10,18 @@ const { product } = Astro.props; --- diff --git a/src/pages/about.astro b/src/pages/about.astro index fedd9c7..4b765b7 100644 --- a/src/pages/about.astro +++ b/src/pages/about.astro @@ -2,7 +2,7 @@ import Layout from '../layouts/Layout.astro'; import CategoryCard from '../components/CategoryCard.astro'; // import { about } from '../data/about'; -import { allCategories } from '../data/categories'; +import { ALL_CATEGORIES } from '../data/categories'; --- @@ -21,11 +21,11 @@ import { allCategories } from '../data/categories';

Who I Am

- My name is David A. Ball. I'm also an expert at making web sites in my spare time. As such, I am uniquely qualified as an expert of both fields. My gift to you is a quick and simple, curated shopping list of things I believe are the most practical and best in-class products. + My name is David A. Ball. I'm also an expert at making web sites in my spare time. As such, I am uniquely qualified as an expert of both fields. My gift to you is a thoughtful, curated shopping list of things I believe are the most practical and best in-class products.

Our Mission

- Dasher Supply strives to document the latest and best quality accesories to help you along your route. I have hand-picked each of these products because I believe each one of these are indispensible tools of the trade. I've shopped ahead so you don't have to. Cut through the noise. Begin all of your shopping journies here. + Dasher Supply strives to document the latest and best quality accesories to help you along your route. I have hand-picked each of these products because I believe each one of these are indispensible tools of the trade from brands you can trust. I've shopped ahead so you don't have to. Cut through the noise. Begin all of your shopping journies here.

Who We Aren't

diff --git a/src/pages/brand/[brandLookup].astro b/src/pages/brand/[brandLookup].astro new file mode 100644 index 0000000..6a25d4e --- /dev/null +++ b/src/pages/brand/[brandLookup].astro @@ -0,0 +1,170 @@ +--- +import Layout from '../../layouts/Layout.astro'; +// import { useState, useEffect } from 'react'; +import { type Brand, ALL_BRANDS } from '../../data/brands'; +import { type Product, ALL_PRODUCTS } from '../../data/products'; +import ProductCard from '../../components/ProductCard.astro'; +import markdownIt from 'markdown-it'; +import markdownItAttrs from 'markdown-it-attrs'; +const md = markdownIt({ + html: true, + linkify: true, + typographer: true, +}).use( + markdownItAttrs, { + // optional, these are default options + leftDelimiter: '{', + rightDelimiter: '}', + allowedAttributes: [] // empty array = all attributes are allowed + } +); + +type BrandStaticPath = { params: { brandLookup: string }}; + +export function getStaticPaths() { + return ALL_BRANDS.map((brand: Brand) => { return { + params: { + brandLookup: brand.slug + } + }}); +} +console.log(getStaticPaths()); + +const { brandLookup } = Astro.params; +const brand: Brand = ALL_BRANDS.find(b => b.slug === brandLookup)!; +const brandProducts: Product[] = ALL_PRODUCTS.filter(p => p.brandStoreSlug === brand.slug)||[]; +--- + + +

+

Dasher Supply > {brand.name} Store

+
+
+ {brand.logoUrl &&
} +
+ {brand.shortDescription &&
} +
+
+ {brand.description &&
} +
+ + + +
+
+

Dasher Supply is not endorsed by or affiliated with DoorDash. As an Amazon Associate I earn from qualifying purchases.

+ About this site. +
+
+
+ + diff --git a/src/pages/category/[categoryLookup].astro b/src/pages/category/[categoryLookup].astro index 742a133..e2d0135 100644 --- a/src/pages/category/[categoryLookup].astro +++ b/src/pages/category/[categoryLookup].astro @@ -1,14 +1,14 @@ --- import Layout from '../../layouts/Layout.astro'; // import { useState, useEffect } from 'react'; -import { allCategories } from '../../data/categories'; -import { allProducts } from '../../data/products'; +import { ALL_CATEGORIES } from '../../data/categories'; +import { ALL_PRODUCTS } from '../../data/products'; import ProductCard from '../../components/ProductCard.astro'; type CategoryStaticPath = { params: { categoryLookup: string }}; export function getStaticPaths() { - return allCategories.map((category) => { return { + return ALL_CATEGORIES.map((category) => { return { params: { categoryLookup: category.seoLink } @@ -17,8 +17,8 @@ export function getStaticPaths() { console.log(getStaticPaths()); const { categoryLookup } = Astro.params; -const category = allCategories.find(c => c.seoLink === categoryLookup)!; -const categoryProducts = allProducts.filter(p => p.categoryId === category.id)!; +const category = ALL_CATEGORIES.find(c => c.seoLink === categoryLookup)!; +const categoryProducts = ALL_PRODUCTS.filter(p => p.categoryId === category.id)!; --- diff --git a/src/pages/index.astro b/src/pages/index.astro index 5dffa66..a84bd4a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,7 +1,9 @@ --- import Layout from '../layouts/Layout.astro'; import CategoryCard from '../components/CategoryCard.astro'; -import { allCategories } from '../data/categories'; +import BrandCard from '../components/BrandCard.astro'; +import { ALL_CATEGORIES } from '../data/categories'; +import { ALL_BRANDS } from '../data/brands'; --- @@ -11,12 +13,22 @@ import { allCategories } from '../data/categories'; Your one-stop shop for all your after-market Dasher supplies.

+

+ We choose brand names you can trust. +

+

Dasher Supply is not endorsed by or affiliated with DoorDash. As an Amazon Associate I earn from qualifying purchases.

About this site. @@ -93,6 +105,10 @@ import { allCategories } from '../data/categories'; gap: 2rem; padding: 0; } + .link-card-grid.brands { + display: flex; + place-items: center; + } a, a:link, a:visited { text-decoration: none; color: #fff } a:hover { text-decoration: underline; color: #fff } diff --git a/src/scraper/amazon.ts b/src/scraper/amazon.ts index 7394665..98719fa 100644 --- a/src/scraper/amazon.ts +++ b/src/scraper/amazon.ts @@ -3,7 +3,7 @@ */ import cheerio, { type CheerioAPI } from 'cheerio'; -import { type ProductDetails } from '../data/products/product-details'; +import { type ProductDetails } from '../data/products/amazon-product-details'; import { type ProductAttribute } from '../data/products/product-attribute'; import { parseNumberFromSelector } from './utils';