A static e-commerce website for La Pistacherie, built with Astro.
Products are managed as markdown files in the src/content/products/ directory. Each category has its own folder:
src/content/products/
├── everyday-gourmet/
├── jar-collection/
├── signature-collection/
└── festive-gifting/
- Navigate to the appropriate category folder
- Create a new
.mdfile (e.g.,cashew-nuts.md) - Add the content as such:
---
title: "Premium Cashew Nuts"
description: "Roasted to perfection, our cashews are a delightful snack"
price: 499
category: "everyday-gourmet"
images:
- "../../assets/cashews.jpg"
featured: false
inStock: true
weight: "250g"
tags: ["nuts", "healthy", "protein"]
---
## Product Description
Write your detailed product description here using markdown.
### Features
- Feature 1
- Feature 2
- Feature 3- Create a new folder in
src/content/products/ - Update
src/content/config.tsto add the new category to the enum:
category: z.enum(['everyday-gourmet', 'jar-collection', 'signature-collection', 'festive-gifting', 'new-category']),- Update the navigation in
src/components/Header.astro - The site will automatically generate listing pages for the new category
Each product markdown file must include these frontmatter fields:
title(required): Product namedescription(required): Short descriptionprice(required): Price in rupees (number)category(required): One of the predefined categoriesimages(required): Array of image pathsfeatured(optional): Boolean, shows on homepage if trueinStock(optional): Boolean, defaults to trueweight(optional): Product weight/quantitytags(optional): Array of tags for categorization
- Place images in the
src/assets/folder - Reference them in product frontmatter:
images:
- "../../assets/product-image.jpg"- Place images in
public/images/ - Update
src/components/HeroSlider.astroto reference them
Update the WhatsApp number in src/components/WhatsAppWidget.astro:
const whatsappNumber = "91XXXXXXXXXX"; // Replace with your numberUpdate site information in src/layouts/Layout.astro:
const { title, description = "La Pistacherie - Premium Dry Fruits and Nuts" } =
Astro.props;Update contact details in:
src/components/Footer.astrosrc/pages/contact.astro
npm run buildThis will:
- Build the static site to
dist/ - Run Pagefind to generate search index
The site can be deployed to any static hosting service:
- Connect your Git repository
- Build command:
npm run build - Publish directory:
dist
- Import your Git repository
- Framework preset: Astro
- Build command:
npm run build - Output directory:
dist
- Connect your repository
- Build command:
npm run build - Build output directory:
dist
# Add to package.json scripts
"deploy": "npm run build && gh-pages -d dist"/
├── public/ # Static assets
│ └── images/ # Hero slider images
├── src/
│ ├── assets/ # Product images (processed by Astro)
│ ├── components/ # Reusable components
│ │ ├── Footer.astro
│ │ ├── Header.astro
│ │ ├── HeroSlider.astro
│ │ ├── ProductCard.astro
│ │ └── WhatsAppWidget.astro
│ ├── content/ # Content collections
│ │ ├── products/ # Product markdown files
│ │ │ ├── everyday-gourmet/
│ │ │ ├── jar-collection/
│ │ │ ├── signature-collection/
│ │ │ └── festive-gifting/
│ │ └── config.ts # Content schema definitions
│ ├── layouts/
│ │ └── Layout.astro # Base layout
│ ├── pages/ # Routes
│ │ ├── index.astro # Homepage
│ │ ├── about.astro # About page
│ │ ├── contact.astro # Contact page
│ │ ├── search.astro # Search page
│ │ ├── personalised-gifting.astro
│ │ └── products/
│ │ ├── index.astro # All products
│ │ ├── [category].astro # Category pages
│ │ └── [category]/[...slug].astro # Product details
│ └── styles/
│ └── global.css # Global styles
├── astro.config.mjs # Astro configuration
├── tailwind.config.mjs # Tailwind configuration
├── tsconfig.json # TypeScript configuration
└── package.json