src/content.config.ts. The portfolio uses Astro’s Content Collections API with Zod schemas for type-safe content management.
Overview
The content configuration defines 11 collections with strict type validation using Zod schemas. Collections are split between data loaders (JSON files) and content-type collections (MDX files).Collection Types
- Data Collections
- Content Collections
Collections that use the
file() loader to load data from JSON files:- socials - Social media links
- books - Book recommendations
- techStack - Technology stack items
- desktopSetup - Desktop setup gear
Data Collections
Socials Collection
Social media profiles and external links.Unique identifier for the social platformExample:
"twitter", "github", "linkedin"Display name of the social platformExample:
"Twitter", "GitHub", "LinkedIn"Full URL to the social profile. Must be a valid URL format.Example:
"https://twitter.com/lewiskori"Validation: z.string().url()Icon identifier for displaying the platform iconExample:
"twitter", "github-alt", "linkedin-in"Accessibility label for screen readersExample:
"Follow me on Twitter", "View my GitHub profile"Books Collection
Recommended books and reading list.Unique identifier for the bookExample:
"atomic-habits", "zero-to-one"Full title of the bookExample:
"Atomic Habits", "Zero to One"Author name(s)Example:
"James Clear", "Peter Thiel"Path or URL to the book cover imageExample:
"/images/books/atomic-habits.jpg"Brief description or review of the bookExample:
"Practical strategies for building good habits and breaking bad ones"Link to purchase or learn more about the bookExample:
"https://amzn.to/..."Tech Stack Collection
Technologies and tools used in development.Unique identifier for the technologyExample:
"astro", "typescript", "tailwind"Display name of the technologyExample:
"Astro", "TypeScript", "Tailwind CSS"Path or URL to the technology logoExample:
"/images/tech/astro.svg"Brief description of how the technology is usedExample:
"Static site generation framework"Official website or documentation URLExample:
"https://astro.build"Validation: z.string().url()Desktop Setup Collection
Physical desk setup and equipment.Unique identifier for the itemExample:
"monitor", "keyboard", "desk"Product nameExample:
"Dell UltraSharp 27\"", "Keychron K2"Path or URL to product imageExample:
"/images/setup/monitor.jpg"Description of the product and why it’s usedExample:
"4K monitor for development work"Purchase link or product pageExample:
"https://amzn.to/..."Content Collections
About Collection
About page content without schema validation.No schema defined - allows flexible frontmatterContent Type: MDX/Markdown files in
src/content/about/Operating Notes Collection
Personal operating principles and work philosophy.Title of the operating noteExample:
"How I Work", "Communication Guidelines"Subtitle or tagline for the noteExample:
"Principles for effective collaboration"Brief description for SEO and previewsExample:
"My approach to async communication and deep work"Last modification dateFormat: ISO date string (coerced to Date object)Example:
"2024-03-15" → Date objectValidation: z.coerce.date()Advisory Collection
Advisory services and consulting information.Title of the advisory service or pageExample:
"Technical Advisory", "Product Strategy"Subtitle describing the serviceExample:
"Help scaling your technical organization"Detailed description for SEOExample:
"Strategic technical advice for growing companies"Last modification dateValidation:
z.coerce.date()Optional featured image for the advisory pageExample:
"/images/advisory/hero.jpg"Blog Collection
Blog posts and articles.Blog post titleExample:
"Building Scalable Systems"Author nameExample:
"Lewis Kori"Array of tag strings for categorizationExample:
["python", "web-development", "api"]Validation: z.array(z.string())Post summary for SEO and previewsExample:
"Learn how to build scalable backend systems"Publication dateValidation:
z.coerce.date()Optional cover image pathExample:
"/images/blog/post-cover.jpg"Optional series name if post is part of a seriesExample:
"Django REST Framework Tutorial"Optional array of sponsor IDs for the postExample:
["sponsor-1", "sponsor-2"]Validation: z.array(z.string())Optional canonical URL if post was published elsewhere firstExample:
"https://dev.to/lewiskori/..."Validation: z.string().url()Experience Collection
Professional work experience entries.Company or organization nameExample:
"Acme Corp", "Self-employed"Company website URLExample:
"https://acmecorp.com"Validation: z.string().url()Job title or roleExample:
"Senior Software Engineer", "CTO"Employment period as a stringExample:
"Jan 2020 - Present", "2018-2020"Numeric order for sorting (lower numbers first)Example:
1, 2, 3Usage: Used to control display order of experience entriesProjects Collection
Portfolio projects showcase.Project nameExample:
"E-commerce Platform", "API Gateway"Array of technologies usedExample:
["React", "Node.js", "PostgreSQL"]Validation: z.array(z.string())Optional live project URLExample:
"https://project.com"Validation: z.string().url()Optional GitHub repository URLExample:
"https://github.com/user/repo"Validation: z.string().url()Optional iOS App Store URLExample:
"https://apps.apple.com/..."Validation: z.string().url()Optional Google Play Store URLExample:
"https://play.google.com/store/apps/..."Validation: z.string().url()Optional project cover imageExample:
"/images/projects/project-cover.jpg"Whether to feature this project prominentlyExample:
true, falseDefault: false (if not specified)Year the project was completed or launchedExample:
2024, 2023Optional company or context where project was madeExample:
"Acme Corp", "Personal Project"Sponsors Collection
Site sponsors and supporters.Sponsor name or companyExample:
"Acme Corp", "John Doe"Sponsor website URLExample:
"https://sponsor.com"Validation: z.string().url()Optional Twitter/X profile URLExample:
"https://twitter.com/sponsor"Validation: z.string().url()Optional sponsor logo pathExample:
"/images/sponsors/logo.svg"Brief description of the sponsorExample:
"Building the future of developer tools"Whether to feature this sponsor prominentlyExample:
true, falseComplete Schema Definition
Usage Example
Query content collections in your Astro pages:Type Safety
All schemas provide full TypeScript type safety:Related Configuration
- Astro Configuration - Core Astro framework settings
- Site Configuration - Site metadata and personal information