This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
microfolio is a static portfolio generator built with SvelteKit 2, Svelte 5, and Tailwind CSS 4. It uses a file-based CMS (Markdown + YAML frontmatter) for content. Developed by AKER.
pnpm dev # Development server
pnpm build # Production build (via build.js → vite build)
pnpm deploy # Build with NODE_ENV=production (sets /microfolio base path)
pnpm preview # Preview production build
pnpm lint # Prettier check + ESLint
pnpm format # Prettier auto-fix
pnpm optimize-images # Generate WebP thumbnails via sharp
pnpm clean-images # Remove generated optimized imagesPackage manager: pnpm (locked to 9.12.0). Node.js 20+ required. No test framework configured.
Projects live in /content/projects/{slug}/ with:
index.md— YAML frontmatter (title, date, location, coordinates, type, tags, featured, authors) + Markdown bodythumbnail.jpg— Project thumbnail (optionalthumbnail.webpfor optimized version)images/,videos/,documents/— Resource subdirectories
Homepage content: /content/index.md. About page: /content/about.md.
All routes use server-side loading (+page.server.js) that reads content from the filesystem at build time:
src/routes/+page.server.js— Loads homepage + featured projects (filtered byfeatured: true)src/routes/projects/+page.server.js— Delegates to$lib/utils/projects.jsshared loadersrc/routes/projects/[slug]/+page.server.js— Loads single project with resources and EXIF metadata extractionsrc/routes/list/,map/,about/— Each has its own+page.server.js
Content parsing pattern: split on ---, parse YAML with yaml, convert Markdown with marked.
$lib/utils/paths.js—getBasePath(): returns/microfolioin production, empty string otherwise (mirrorssvelte.config.jslogic)$lib/utils/projects.js—loadProjects(): shared project loading used by/projects,/list,/map$lib/utils/imageMetadata.js— EXIF/IPTC extraction viaexifreader(credit, camera, GPS, etc.)$lib/config.js— Site config (title, social links, navigation)$lib/i18n.js— Internationalization setup withsvelte-i18n(en/fr active, more commented out)
- Tailwind CSS 4 configured in
src/app.csswith@tailwindcss/typographyplugin - Custom theme in
src/lib/theme.css - Dark mode via
prefers-color-schememedia query with CSS custom properties - Font: IBM Plex Sans (loaded from bunny.net CDN)
All custom components use Ak prefix (e.g., AkHeader, AkFooter, AkProjectCard, AkFilters, AkOptimizedImage). Datatable components (Datatable, Search, ThSort, ThFilter, Pagination, RowCount, RowsPerPage) power the /list view using @vincjo/datatables.
- Static site generation via
@sveltejs/adapter-static(output:/build) svelte.config.jsdynamically generates prerender entries by scanning/content/projects/vite.config.jscopies thecontent/directory to build output viavite-plugin-static-copy(build only, not dev)- Icons via
unplugin-iconswith Iconify JSON - Base path:
/microfolioin production, empty in dev. SetCUSTOM_DOMAIN=trueenv var to remove base path for custom domains - Layout (
+layout.js):prerender = true,trailingSlash = 'always'
- Locale strings in
src/lib/locales/{lang}.json - Default locale set in
$lib/config.js(siteConfig.locale) - RTL support in
+layout.svelte(auto-detects and setsdirattribute)
title: 'Project Title'
date: '2023-01-01'
location: 'City, Country'
coordinates: [latitude, longitude] # For map display
description: 'Project description'
type: 'architecture' # Used for filtering
tags: ['tag1', 'tag2']
authors:
- name: 'Author Name'
role: 'Role'
featured: true # Shows on homepage