From eec9d959a0b1a509e4a585def36e9a817ab408c1 Mon Sep 17 00:00:00 2001 From: Hans Josephsen Date: Wed, 15 Oct 2025 19:14:21 +0200 Subject: [PATCH 1/2] add sponsors --- CLAUDE.md | 58 ++++++++ src/assets/logos/nrk.svg | 1 + src/assets/logos/sparebank1-smn.svg | 75 +++++++++++ src/components/landing/Sponsorer.astro | 176 +++++++++++++++++++++++++ src/pages/index.astro | 36 ++++- 5 files changed, 343 insertions(+), 3 deletions(-) create mode 100644 CLAUDE.md create mode 100644 src/assets/logos/nrk.svg create mode 100644 src/assets/logos/sparebank1-smn.svg create mode 100644 src/components/landing/Sponsorer.astro 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/components/landing/Sponsorer.astro b/src/components/landing/Sponsorer.astro new file mode 100644 index 0000000..4adb4bd --- /dev/null +++ b/src/components/landing/Sponsorer.astro @@ -0,0 +1,176 @@ +--- +import { Image } from "astro:assets"; + +export interface Props { + id?: string; + title: string; + description?: 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 } = + 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 + } +
+
diff --git a/src/pages/index.astro b/src/pages/index.astro index bf3a3a9..6af5a13 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -9,12 +9,15 @@ 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 nrkLogo from "../assets/logos/nrk.svg"; --- @@ -51,7 +54,7 @@ import toolsImage from "../assets/tools.jpg"; -
+
+
+ +
+
+ +
From 80d7c654fca58a14ff35d6eea2162ae4dd5af3db Mon Sep 17 00:00:00 2001 From: nikolai Date: Wed, 22 Oct 2025 20:11:47 +0200 Subject: [PATCH 2/2] modified sponspor cards --- src/assets/logos/sponsor1.svg | 14 ++++++ src/assets/logos/sponsor2.svg | 14 ++++++ src/assets/logos/sponsor3.svg | 13 +++++ src/components/landing/Sponsorer.astro | 68 ++++++++++++++++++-------- src/pages/index.astro | 20 +++++++- 5 files changed, 106 insertions(+), 23 deletions(-) create mode 100644 src/assets/logos/sponsor1.svg create mode 100644 src/assets/logos/sponsor2.svg create mode 100644 src/assets/logos/sponsor3.svg 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 index 4adb4bd..3b5d226 100644 --- a/src/components/landing/Sponsorer.astro +++ b/src/components/landing/Sponsorer.astro @@ -5,6 +5,10 @@ export interface Props { id?: string; title: string; description?: string; + sponsCallout?: { + text: string; + url: string; + }; sponsorTiers?: Array<{ tierName: string; sponsors: Array<{ @@ -23,10 +27,11 @@ export interface Props { url?: string; description?: string; }>; + backgroundClass?: string; } -const { id, title, description, sponsorTiers, sponsors, backgroundClass } = +const { id, title, description, sponsorTiers, sponsors, backgroundClass, sponsCallout} = Astro.props; const logoSizeClasses = { @@ -38,7 +43,7 @@ const logoSizeClasses = {
-
+

{tier.tierName}

-
+
{tier.sponsors.map((sponsor) => { const logoSizeClass = logoSizeClasses[tier.logoSize || "md"]; const sponsorContent = ( -
+
{sponsor.logo ? ( )} {sponsor.logo && ( -
+
{sponsor.name}
)} @@ -106,13 +111,17 @@ const logoSizeClasses = { href={sponsor.url} target="_blank" rel="noopener noreferrer" - class="block text-inherit no-underline" + class="flex text-inherit no-underline" > {sponsorContent} ); } else { - return sponsorContent; + return ( +
+ {sponsorContent} +
+ ); } })}
@@ -120,20 +129,22 @@ const logoSizeClasses = { ))}
) : sponsors ? ( -
+
{sponsors.map((sponsor) => { const sponsorContent = ( -
+
{sponsor.logo ? ( - { +
+ { +
) : (
@@ -147,7 +158,7 @@ const logoSizeClasses = {
)} {sponsor.logo && ( -
+
{sponsor.name}
)} @@ -160,17 +171,32 @@ const logoSizeClasses = { href={sponsor.url} target="_blank" rel="noopener noreferrer" - class="block text-inherit no-underline" + class="flex text-inherit no-underline" > {sponsorContent} ); } else { - return sponsorContent; + return ( +
+ {sponsorContent} +
+ ); } })}
) : null } + {sponsCallout && +
+

+ {sponsCallout.text} +

+ + + les mer her + +
+ }
diff --git a/src/pages/index.astro b/src/pages/index.astro index 6af5a13..054bf9a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -17,6 +17,8 @@ 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"; --- @@ -209,12 +211,26 @@ import nrkLogo from "../assets/logos/nrk.svg";