Skip to content

Manage content for static or dynamic websites using Typescript and git.

License

Notifications You must be signed in to change notification settings

cloetensbrecht/alinea

 
 

Repository files navigation

npm install size

Alinea CMS logo

Alinea is a modern content management system.

  • Content is stored in flat files and committed to your repository
  • Content is easily queryable through an in-memory SQLite database
  • Content is fully typed

Get started

Install alinea in your project directory

npm install alinea

Initialize alinea's config file

npx alinea init --next

Open the dashboard to have a look around

npx alinea dev

Start configuring types and fields →

Configure

Configure alinea in cms.tsx

import {Config, Field} from 'alinea'

const Blog = Config.document('Blog', {
  contains: ['BlogPost']
})
const BlogPost = Config.document('Blog post', {
  fields: {
    title: Field.text('Blog entry title'),
    body: Field.richText('Body text')
  }
})

Type options and fields →

Query

Retrieve content fully-typed and filter, order, limit as needed.
Select only the fields you need.

import {Query} from 'alinea'

const blogAndPosts = Query(Blog).select({
  title: Blog.title,
  posts: Query.children(BlogPost).select({
    title: BlogPost.title
  })
})

console.log(await cms.get(blogAndPosts))

See the full api →

Content is available during static site generation and when server side querying.
Content is bundled with your code and can be queried with zero network overhead.

How alinea bundles content →

Deploy anywhere

Alinea supports custom backends that can be hosted as a simple Node.js process or on serverless runtimes.

Setup your backend →

How to contribute to this project

Have a question or an idea? Found a bug? Read how to contribute.

About

Manage content for static or dynamic websites using Typescript and git.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 91.2%
  • SCSS 7.4%
  • JavaScript 1.3%
  • CSS 0.1%