Other Collections
Beyond blog posts, Velocity includes collections for authors, FAQs, and pages.
Authors Collection
Section titled “Authors Collection”Author profiles stored as JSON in src/content/authors/.
Schema
Section titled “Schema”{ "name": "Jane Doe", "bio": "Senior developer at Acme Corp", "avatar": "./avatars/jane.jpg", "social": { "twitter": "@janedoe", "github": "janedoe" }}Querying Authors
Section titled “Querying Authors”---import { getCollection } from 'astro:content';
const authors = await getCollection('authors');const author = authors.find(a => a.data.name === 'Jane Doe');---Usage with Posts
Section titled “Usage with Posts”---const post = Astro.props.post;const authors = await getCollection('authors');const author = authors.find(a => a.data.name === post.data.author);---
<div class="flex items-center gap-3"> <img src={author.data.avatar} alt={author.data.name} class="w-10 h-10 rounded-full" /> <div> <p class="font-medium">{author.data.name}</p> <p class="text-sm text-foreground-muted">{author.data.bio}</p> </div></div>FAQs Collection
Section titled “FAQs Collection”FAQ entries stored as JSON in src/content/faqs/.
Schema
Section titled “Schema”{ "question": "What is Velocity?", "answer": "Velocity is a modern Astro starterkit with 56 components, a complete design system, and full SEO toolkit.", "category": "general", "order": 1, "locale": "en"}Querying FAQs
Section titled “Querying FAQs”---import { getCollection } from 'astro:content';
const faqs = await getCollection('faqs');
// Filter by categoryconst generalFaqs = faqs.filter(f => f.data.category === 'general');
// Sort by orderconst sortedFaqs = faqs.sort((a, b) => a.data.order - b.data.order);---Rendering FAQs
Section titled “Rendering FAQs”<div class="space-y-4"> {faqs.map((faq) => ( <details class="border border-border rounded-lg p-4"> <summary class="font-medium cursor-pointer"> {faq.data.question} </summary> <p class="mt-2 text-foreground-muted"> {faq.data.answer} </p> </details> ))}</div>FAQ Schema for SEO
Section titled “FAQ Schema for SEO”---import JsonLd from '@/components/seo/JsonLd.astro';import { createFAQSchema } from '@/lib/schema';---
<JsonLd schema={createFAQSchema(faqs)} />Pages Collection
Section titled “Pages Collection”Static pages stored as MDX in src/content/pages/.
Schema
Section titled “Schema”---title: "About Us"description: "Learn more about our team"updatedAt: 2026-01-15locale: en---Querying Pages
Section titled “Querying Pages”---import { getCollection, render } from 'astro:content';
const pages = await getCollection('pages');const aboutPage = pages.find(p => p.id === 'about');const { Content } = await render(aboutPage);---
<Content />Adding New Collections
Section titled “Adding New Collections”1. Define Schema
Section titled “1. Define Schema”import { defineCollection, z } from 'astro:content';import { glob } from 'astro/loaders';
const projects = defineCollection({ loader: glob({ pattern: '**/*.md', base: './src/content/projects' }), schema: z.object({ title: z.string(), client: z.string(), year: z.number(), image: z.string().optional(), url: z.string().url().optional(), }),});
export const collections = { blog, pages, authors, faqs, projects, // Add new collection};2. Create Content Folder
Section titled “2. Create Content Folder”src/content/projects/├── project-one.md└── project-two.md3. Add Content
Section titled “3. Add Content”---title: "E-commerce Platform"client: "Acme Corp"year: 2026image: ./screenshot.pngurl: https://acme.example.com---
Description of the project...4. Query and Display
Section titled “4. Query and Display”---import { getCollection } from 'astro:content';const projects = await getCollection('projects');---
<div class="grid md:grid-cols-2 gap-6"> {projects.map((project) => ( <Card> <h3>{project.data.title}</h3> <p>{project.data.client} • {project.data.year}</p> </Card> ))}</div>