nuxt-x-blog
Nuxt layer for blog functionality powered by Nuxt Content v3 with SQLite storage.
nuxt-x-blog
Nuxt layer for building blog functionality with Nuxt Content v3 integration, SQLite-backed content storage, and pre-built blog UI components.
This package is under active development. Components are being built — check back soon.
Installation
npm install @xenterprises/nuxt-x-blog
// nuxt.config.ts
export default defineNuxtConfig({
extends: ['@xenterprises/nuxt-x-blog'],
})
Content Structure
Create blog posts in content/blog/:
content/
blog/
my-first-post.md
another-post.md
Frontmatter Schema
---
title: My First Post
description: A brief description
date: 2024-01-15
author: John Doe
image: /images/blog/cover.jpg
tags:
- nuxt
- vue
published: true
---
Querying Posts
// Fetch all published posts
const { data: posts } = await useAsyncData('posts', () =>
queryCollection('blog')
.where('published', '=', true)
.order('date', 'desc')
.find()
)
// Fetch single post
const { data: post } = await useAsyncData(`post-${slug}`, () =>
queryCollection('blog')
.where('slug', '=', slug)
.first()
)
Auto-Registered Pages
| Route | Description |
|---|---|
/blog | Blog listing page |
/blog/[slug] | Individual post page |
Components
Components are under development. This section will be updated as they are built.
Planned components:
| Component | Description |
|---|---|
<XBlogList /> | Paginated blog post listing |
<XBlogCard /> | Post preview card |
<XBlogPost /> | Full post renderer |
<XBlogSidebar /> | Tag cloud, recent posts |
<XBlogAuthor /> | Author bio block |
<XBlogRelated /> | Related posts section |
AI Context
package: "@xenterprises/nuxt-x-blog"
version: "0.0.2"
status: in-development
type: nuxt-layer
content-engine: "@nuxt/content v3"
storage: SQLite (better-sqlite3)
content-dir: content/blog/
collection-name: blog
query-api: queryCollection('blog')
auto-pages: [/blog, /blog/[slug]]
use-when: Adding a blog to a Nuxt app with markdown content and auto-routing
frontmatter-required: [title, description, date, published]
frontmatter-optional: [author, image, tags]
