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.
$ npm install noutious
$ yarn add noutious
$ pnpm add noutiousThen create an instance:
import { createNoutious } from 'noutious';
const noutious = await createNoutious({
baseDir: './', // required, where noutious works
persist: false, // pre-process data at ${baseDir}/data.json and read data from this file
draft: false, // draft mode
excerpt: '<!-- more -->', // excerpt mark
});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
limit: 5, // limit posts query amount
});const categories = await noutious.queryCategories();const tags = await noutious.queryTags();const post = await noutious.queryPost(
// query by slug
'hello-world',
// sort posts by date, for query previous post and next post.
{ sort: { date: -1 } }
);