diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..560c52a --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,58 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Development Commands + +This project uses **pnpm** as the package manager. Common commands: + +- `pnpm dev` - Start development server (http://localhost:4321) +- `pnpm build` - Build for production +- `pnpm preview` - Preview production build locally +- `pnpm devdeploy` - Build and deploy to Cloudflare + +## Architecture Overview + +This is an **Astro + Starlight** website for Hackheim, a makerspace in Trondheim. The site combines a public landing page with documentation using Starlight. + +### Tech Stack +- **Framework**: Astro 5+ with static output +- **Documentation**: Starlight integration for wiki/docs +- **UI Components**: Svelte 5 components +- **Styling**: TailwindCSS 4 +- **Deployment**: Cloudflare Pages via Wrangler +- **Content**: Markdown with content collections + +### Key Architecture Patterns + +**Hybrid Site Structure**: The site serves both as a public website (`/`) and documentation platform (`/wiki/*`): +- Landing page: `src/pages/index.astro` with modular landing components +- Documentation: Handled by Starlight integration in `astro.config.mjs` +- Content collections: Defined in `src/content.config.ts` + +**Content Collections**: +- `docs/` - Starlight documentation (Norwegian with English translation) +- `projects/` - Project showcases with rich metadata (difficulty, tools, materials) +- `news/` - News articles and announcements +- `pages/` - General content pages + +**Component Organization**: +- `src/components/landing/` - Landing page sections (Hero, About, Equipment, etc.) +- `src/components/starlight/` - Custom Starlight component overrides +- `src/components/svelte/` - Interactive Svelte components + +**Internationalization**: +- Default locale: Norwegian (`nb-NO`) +- Secondary: English (`en`) +- Configured in Starlight for documentation sections + +### Deployment + +- **Development**: `pnpm devdeploy` builds and deploys to Cloudflare +- **Production**: Auto-deployment via GitHub integration +- Static build output deployed to Cloudflare Pages +- Configuration in `wrangler.toml` + +### Path Aliases + +TypeScript path alias configured: `@components/*` maps to `src/components/*` \ No newline at end of file diff --git a/src/assets/logos/nrk.svg b/src/assets/logos/nrk.svg new file mode 100644 index 0000000..1aaaa4b --- /dev/null +++ b/src/assets/logos/nrk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/logos/sparebank1-smn.svg b/src/assets/logos/sparebank1-smn.svg new file mode 100644 index 0000000..e93244a --- /dev/null +++ b/src/assets/logos/sparebank1-smn.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/logos/sponsor1.svg b/src/assets/logos/sponsor1.svg new file mode 100644 index 0000000..b6f9093 --- /dev/null +++ b/src/assets/logos/sponsor1.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/logos/sponsor2.svg b/src/assets/logos/sponsor2.svg new file mode 100644 index 0000000..5c649ad --- /dev/null +++ b/src/assets/logos/sponsor2.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/logos/sponsor3.svg b/src/assets/logos/sponsor3.svg new file mode 100644 index 0000000..69363e6 --- /dev/null +++ b/src/assets/logos/sponsor3.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/landing/Sponsorer.astro b/src/components/landing/Sponsorer.astro new file mode 100644 index 0000000..3b5d226 --- /dev/null +++ b/src/components/landing/Sponsorer.astro @@ -0,0 +1,202 @@ +--- +import { Image } from "astro:assets"; + +export interface Props { + id?: string; + title: string; + description?: string; + sponsCallout?: { + text: string; + url: string; + }; + sponsorTiers?: Array<{ + tierName: string; + sponsors: Array<{ + name: string; + logo?: ImageMetadata; + logoAlt?: string; + url?: string; + description?: string; + }>; + logoSize?: "sm" | "md" | "lg"; + }>; + sponsors?: Array<{ + name: string; + logo?: ImageMetadata; + logoAlt?: string; + url?: string; + description?: string; + }>; + + backgroundClass?: string; +} + +const { id, title, description, sponsorTiers, sponsors, backgroundClass, sponsCallout} = + Astro.props; + +const logoSizeClasses = { + sm: "max-h-12", + md: "max-h-16", + lg: "max-h-20", +}; +--- + +
+
+
+

+ {title} +

+ { + description && ( +

+ {description} +

+ ) + } +
+ + { + sponsorTiers ? ( +
+ {sponsorTiers.map((tier) => ( +
+

+ {tier.tierName} +

+
+ {tier.sponsors.map((sponsor) => { + const logoSizeClass = + logoSizeClasses[tier.logoSize || "md"]; + const sponsorContent = ( +
+ {sponsor.logo ? ( + { + ) : ( +
+
+ {sponsor.name} +
+ {sponsor.description && ( +
+ { + sponsor.description + } +
+ )} +
+ )} + {sponsor.logo && ( +
+ {sponsor.name} +
+ )} +
+ ); + + if (sponsor.url) { + return ( + + {sponsorContent} + + ); + } else { + return ( +
+ {sponsorContent} +
+ ); + } + })} +
+
+ ))} +
+ ) : sponsors ? ( +
+ {sponsors.map((sponsor) => { + const sponsorContent = ( +
+ {sponsor.logo ? ( +
+ { +
+ ) : ( +
+
+ {sponsor.name} +
+ {sponsor.description && ( +
+ {sponsor.description} +
+ )} +
+ )} + {sponsor.logo && ( +
+ {sponsor.name} +
+ )} +
+ ); + + if (sponsor.url) { + return ( + + {sponsorContent} + + ); + } else { + return ( +
+ {sponsorContent} +
+ ); + } + })} +
+ ) : null + } + {sponsCallout && +
+

+ {sponsCallout.text} +

+ + + les mer her + +
+ } +
+
diff --git a/src/pages/index.astro b/src/pages/index.astro index bf3a3a9..054bf9a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -9,12 +9,17 @@ import Community from "../components/landing/Community.astro"; import ProjectShowcase from "../components/landing/ProjectShowcase.astro"; import Gallery from "../components/landing/Gallery.astro"; import OpenDays from "../components/landing/OpenDays.astro"; +import Sponsorer from "../components/landing/Sponsorer.astro"; import Footer from "../components/landing/Footer.astro"; import heroImage from "../assets/sparkly.jpg"; import communityImage from "../assets/folk.jpg"; import printersImage from "../assets/printers.jpg"; import toolsImage from "../assets/tools.jpg"; +import sparebank1SMNLogo from "../assets/logos/sparebank1-smn.svg"; +import testIndustriesLogo from "../assets/logos/sponsor1.svg"; +import placecolderCompany from "../assets/logos/sponsor2.svg"; +import nrkLogo from "../assets/logos/nrk.svg"; --- @@ -51,7 +56,7 @@ import toolsImage from "../assets/tools.jpg"; -
+
+
+ +
+
+ +