Skip to content

s-complex/noutious

Repository files navigation

Noutious

A file-based content manage system, driven by Node.js. This project was inspired by Hexo and Nuxt Content.

Important

This project is still in development, bugs and mistakes are everywhere. DO NOT USE IT IN PRODUCTION.

Quick Start

$ npm install noutious
$ yarn add noutious
$ pnpm add noutious

Then create an instance:

import { createNoutious } from 'noutious'

const noutious = await createNoutious({
    baseDir: process.cwd() // required
    persist: false
    draft: false
    excerpt: '<!-- more -->'
})

Usage

Query all posts

const posts = await noutious.queryPosts({
    // options
    sort: { date: -1 } // sort posts by date, value: 1 | -1
    include: { categories: 'Noutious' } // filter posts by specific front-matter value
})

Query all categories

const categories = await noutious.queryCategories();

Query all tags

const tags = await noutious.queryTags();

Query specific posts

const { post, prev, next } = await noutious.queryPost(
	// query by slug
	'hello-world',
	// sort posts by date, but for query previous post and next post.
	{ sort: { date: -1 } }
);

License

MIT

About

Lightweright filed-based CMS integration, for Node.js front-end frameworks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5