Resource Collections Overview
Three resource collections are defined insrc/content.config.ts:
- books - Book recommendations and reading list
- techStack - Technologies and tools you use
- desktopSetup - Your hardware and workspace setup
file() loader to read data from JSON files in src/data/.
Books Collection
Books are stored insrc/data/books.json and showcase your reading list and recommendations.
Schema
string
required
Unique identifier for the book (e.g., “clean-code”, “pragmatic-programmer”)
string
required
The book title (e.g., “Clean Code”)
string
required
The author’s name (e.g., “Robert C. Martin”)
string
required
URL to the book cover image
string
required
A brief description or review of the book
string
required
Link to purchase or learn more about the book
Adding a Book
Editsrc/data/books.json and add a new entry to the array:
Real Book Examples
Tech Stack Collection
Your tech stack is stored insrc/data/tech-stack.json and showcases the technologies and tools you use.
Schema
string
required
Unique identifier (e.g., “python”, “typescript”, “docker”)
string
required
Display name of the technology (e.g., “Python”, “TypeScript”)
string
required
URL to the technology logo or icon
string
required
Why you use this technology and what you use it for
string (URL)
required
Official website or documentation link
Adding a Tech Stack Item
Editsrc/data/tech-stack.json and add a new entry:
Use Devicon for consistent, high-quality technology logos. The CDN URL format is:
https://cdn.jsdelivr.net/gh/devicons/devicon/icons/{name}/{name}-original.svgReal Tech Stack Examples
Desktop Setup Collection
Your desktop setup is stored insrc/data/desktop-setup.json and showcases your hardware and workspace.
Schema
string
required
Unique identifier (e.g., “macbook-pro”, “mx-keys-mini”)
string
required
Product name (e.g., “MacBook Pro 14"", “Logitech MX Keys Mini”)
string
required
URL to a product image
string
required
Details about the product and why you use it
string
required
Link to product page or specifications (use ”#” if no specific link)
Adding a Desktop Setup Item
Editsrc/data/desktop-setup.json and add a new entry:
Real Desktop Setup Examples
File Locations
Resource data files are stored insrc/data/:
Querying Resources
In your Astro components, query resource collections like any other content collection:Example Component Usage
Best Practices
Books
- Use high-quality cover images - Preferably from official sources
- Write personal descriptions - Explain why you recommend the book and what you learned
- Link to official sources - Use publisher or author websites when possible
- Include diverse topics - Mix technical books with career development and design
- Update regularly - Add new books as you read them
Tech Stack
- Use Devicon for consistency - Get logos from Devicons
- Be personal in descriptions - Explain why you use each technology
- Keep it current - Remove technologies you no longer use actively
- Order by importance - Put your primary technologies first in the array
- Link to official docs - Use the main documentation site for each technology
Desktop Setup
- Use quality product images - High-resolution images make setup pages look professional
- Include specifications - Mention key specs (RAM, storage, etc.) in descriptions
- Explain your choices - Tell readers why you chose each item
- Link to products - Help readers find the exact items if interested
- Keep it realistic - Only include items you actually use
Image Guidelines
For Books
- Use official cover images from publishers
- Minimum 300x400px resolution
- Prefer square or portrait orientation
For Tech Stack
- Use SVG logos from Devicon when possible
- Consistent icon style across all items
- Transparent backgrounds work best
For Desktop Setup
- High-resolution product photos (800px+ width)
- Consistent photo style if possible
- Use Unsplash for generic items like desks
JSON Validation
All resource JSON files must be valid JSON arrays. Common mistakes to avoid:Use a JSON validator or your editor’s JSON validation to catch syntax errors before committing changes.
Adding New Resource Types
To add a new resource collection:1
Create the JSON data file
2
Define the collection schema
Edit
src/content.config.ts and add a new collection:3
Export the collection
Add it to the exports:
4
Query in your pages