Files
yoyos.sh/src/content.config.ts
T
Johan Sandoval ef9d597b52
Mirror to Gitea / mirror (push) Skipped
Redesign with per-page themes and plain wording
Each page now has its own look drawn from print and retro-tech references:
magazine-cover home, subway-map work index, technical-poster project pages,
90s-desktop blog, radio-flyer music page, 80s wireframe 3D page, garden
about page and postcard contact form. A shared subway-line color system
ties sections and project categories together.

Replace themed copy with standard wording (Work, Blog, Music, 3D, About,
Contact; Selected work, Experience, Get in touch). Rename /log to /blog and
/sound to /music with redirects.
2026-10-08 15:36:51 +00:00

91 lines
2.9 KiB
TypeScript

import { defineCollection } from 'astro:content';
import { glob } from 'astro/loaders';
import { z } from 'astro/zod';
import { THEMES } from './lib/themes';
const theme = z.enum(THEMES).optional();
import { DISCIPLINES } from './lib/disciplines';
/**
* Projects. One .md/.mdx file per project in src/content/work/.
* Folder-style entries (work/my-thing/index.mdx) can keep their images alongside.
*/
const work = defineCollection({
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/work' }),
schema: ({ image }) =>
z.object({
title: z.string(),
summary: z.string(),
disciplines: z.array(z.enum(DISCIPLINES)).min(1),
stack: z.array(z.string()).default([]),
date: z.coerce.date(),
status: z.enum(['live', 'shipped', 'in-progress', 'archived']).default('shipped'),
role: z.string().optional(),
cover: image().optional(),
coverAlt: z.string().optional(),
links: z
.array(z.object({ label: z.string(), href: z.string() }))
.default([]),
// Playable build served from /media (see src/pages/play/[slug].astro)
game: z
.object({
engine: z.enum(['godot', 'unity', 'web']),
// folder inside the media share, e.g. "games/my-game"
path: z.string(),
entry: z.string().default('index.html'),
aspect: z.string().default('16 / 9'),
})
.optional(),
// .glb in the media share, shown with <model-viewer>
model: z.string().optional(),
featured: z.boolean().default(false),
placeholder: z.boolean().default(false),
theme,
}),
});
/** Weekly blog. */
const blog = defineCollection({
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }),
schema: ({ image }) =>
z.object({
title: z.string(),
summary: z.string(),
date: z.coerce.date(),
tags: z.array(z.string()).default([]),
cover: image().optional(),
coverAlt: z.string().optional(),
draft: z.boolean().default(false),
theme,
}),
});
/** Recordings. Audio files live in the media share under music/. */
const music = defineCollection({
loader: glob({ pattern: '**/*.{md,yaml,yml,json}', base: './src/content/music' }),
schema: z.object({
title: z.string(),
date: z.coerce.date(),
file: z.string(),
duration: z.string().optional(),
notes: z.string().optional(),
gear: z.array(z.string()).default([]),
}),
});
/** 3D models. .glb files live in the media share under models/. */
const models = defineCollection({
loader: glob({ pattern: '**/*.{md,yaml,yml,json}', base: './src/content/models' }),
schema: z.object({
title: z.string(),
date: z.coerce.date(),
file: z.string(),
poster: z.string().optional(),
tools: z.array(z.string()).default([]),
notes: z.string().optional(),
}),
});
export const collections = { work, blog, music, models };