0.1.6 • Published 10 years ago

atomicms v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

atomicms

npm version Build Status Dependency Status Coverage Status Code Climate License

CMS module inspired by atomic design

Example

const express = require('express');
let app = express();

const atomicms = require('atomicms');
let cms = new atomicms();

app.get('/', cms.requestHandler);

API

Atomicms takes an opts object specifing the paths of key.json, templates, organisms and content.

Default opts object:

{
  key: 'key.json',
  content: 'content',
  template: 'templates',
  organism: 'organisms'
}

key.json

key.json is where it comes all together. One template and content are assigned to one url respectively.

Example:

{
  '/index': {
    'template': 'index.html',
    'content': 'index.json'
  }
}

Organisms

Organisms can reside in templates and are referenced using markup-js syntax.

Example:

template index.html

<body>
    {{oHeader as header}}
</body>

organism oHeader.html

<h1>{{title}}</h1>
<img src={{img}}>
<p><strong>{{content}}</strong></p>

content index.json

{
  'header': {
    'title': ...,
    'img': ...,
    'content': ...
  }
}

Installation

npm install atomicms
0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago