@lupinum/ginko-content
v0.1.2
Published
Collection-first content engine for Nuxt
Readme
@lupinum/ginko-content
Filesystem-first content for Nuxt 4.
Write Markdown and data files in content/, define collections once in
content.config.ts, then use those collection handles for route pages, lists,
navigation, search, i18n, and sitemap output.
Use it when you want content files to stay simple, but your Nuxt app still needs explicit APIs for route resolution, typed frontmatter, localized content, and server-side reads.
Requirements
- Node.js 20 or later
- Nuxt 4.0 or later
Install
npx nuxi module add @lupinum/ginko-contentThe Nuxt CLI installs the package and registers the module in nuxt.config.ts.
If you prefer to install by hand:
pnpm add @lupinum/ginko-contentexport default defineNuxtConfig({
modules: ['@lupinum/ginko-content'],
imports: {
autoImport: true
}
})Quick Start
Define a collection:
// content.config.ts
import { defineCollection, defineContentConfig } from '@lupinum/ginko-content/config'
export const pages = defineCollection({
type: 'page',
source: '**/*.md'
})
export default defineContentConfig({
collections: {
pages
}
})Create content/index.md:
---
title: Welcome
---
# Welcome
This file renders at `/`.Render the current route through the collection:
<!-- pages/[...slug].vue -->
<script setup lang="ts">
const { page } = await useContentPage('pages')
</script>
<template>
<ContentRenderer v-if="page" :value="page" />
</template>Features
- file-authored pages and navigation from
content/ - collection definitions as the source of truth for content shape and source files
- Markdown, Comark component tags, YAML, JSON, and CSV ingestion
- locale-aware content routing
- route-aware page loading with
useContentPage('pages') - semantic previous/next route-page data through
useContentPage('pages', { surround }) - server reads through
one,many,paginate,resolveOne,tree, andneighbors - Vue composables for the same read model
- search helpers for MiniSearch, Pagefind, and provider-owned search
- sitemap integration for public content routes
- a server-side provider contract for advanced custom sources
I18n, Sitemap, and Prerender Ownership
For localized Nuxt apps, keep one source of truth per route type:
- Static Nuxt page paths belong in Nuxt I18n
i18n.pages. - Content page paths belong in Ginko collection routes and content files.
- Sitemap XML is generated by
@nuxtjs/sitemap. - Ginko registers the content sitemap source and contributes content prerender routes.
Do not duplicate docs, blog, pricing, privacy, or translated locale paths in
sitemap.urls or app-owned nitro.prerender.routes arrays. Use
@nuxtjs/sitemap >= 8.0.15 when translated static app slugs such as /preise
and /en/pricing need cross-locale sitemap alternates.
See the public guide: Sitemap and prerender.
Scope
The default provider reads files from your Nuxt project. The package does not include a CMS UI, Studio, admin panel, or content editing workflow.
Docs
- Documentation: ginko-content.nuxt.dev
- Repository: github.com/lupinum-dev/ginko-content
Credits
Ginko Content is its own implementation, with clear inspiration from Nuxt Content, Nuxt UI, and Comark, the successor to the previous MDC work.
