
Velite Has a Free Content Layer for Static Sites — Here's How to Use It
Contentlayer is abandoned. MDX is setup-heavy. Velite turns your Markdown, YAML, and JSON files into type-safe, validated collections — with zero runtime overhead. What Is Velite? Velite is a content build tool that transforms local files (Markdown, MDX, YAML, JSON) into type-safe data collections. Think of it as a "content compiler" for your static site. Quick Start npm install velite // velite.config.ts import { defineConfig , s } from ' velite ' ; export default defineConfig ({ collections : { posts : { name : ' Post ' , pattern : ' posts/**/*.md ' , schema : s . object ({ title : s . string (). max ( 120 ), slug : s . slug ( ' posts ' ), date : s . isodate (), description : s . string (). max ( 300 ), tags : s . array ( s . string ()), draft : s . boolean (). default ( false ), body : s . markdown (), }), }, }, }); Usage // Access typed content in your app import { posts } from ' #content ' ; // posts is fully typed as Post[] const publishedPosts = posts . filter ( post => ! post .
Continue reading on Dev.to Webdev
Opens in a new tab

