All Projects β†’ debitoor β†’ nocms

debitoor / nocms

Licence: other
"NO, You don't need a CMS"

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to nocms

kerouac
Poetic static site generator for Node.js.
Stars: ✭ 80 (+515.38%)
Mutual labels:  static-site-generator
ftd
🚧 (Alpha stage software) FTD: Programming Language For Prose 🚧
Stars: ✭ 18 (+38.46%)
Mutual labels:  static-site-generator
cyrax
Static site generator
Stars: ✭ 41 (+215.38%)
Mutual labels:  static-site-generator
noir
Noir is a modern, responsive and customizable theme for Jekyll with dark mode support.
Stars: ✭ 68 (+423.08%)
Mutual labels:  static-site-generator
github-pages-vuepress
Build a static website using VuePress and deploy to Github Pages
Stars: ✭ 20 (+53.85%)
Mutual labels:  static-site-generator
create-harold-app
Static blog/site generator
Stars: ✭ 33 (+153.85%)
Mutual labels:  static-site-generator
generator-veams
Scaffold modern frontend web apps or web pages with a static site generator (Assemble or Mangony), Grunt and/or Gulp, Sass and Bower. Use modern frameworks like Bourbon, Bootstrap or Foundation and structure your JavaScript with ES Harmony support.
Stars: ✭ 45 (+246.15%)
Mutual labels:  static-site-generator
reslate
Beautiful static documentation for your API
Stars: ✭ 98 (+653.85%)
Mutual labels:  static-site-generator
forty
Forty theme - Hugo theme ported from HTML5UP origrinal theme called Forty.
Stars: ✭ 116 (+792.31%)
Mutual labels:  static-site-generator
PkgPage.jl
Create a beautiful landing page for your package in less than 10 minutes.
Stars: ✭ 98 (+653.85%)
Mutual labels:  static-site-generator
rocket
The modern web setup for static sites with a sprinkle of JavaScript
Stars: ✭ 169 (+1200%)
Mutual labels:  static-site-generator
monopati
a minimalistic static content generator
Stars: ✭ 19 (+46.15%)
Mutual labels:  static-site-generator
picidaejs
🐦Picidae is a document generator which has gentle experience.
Stars: ✭ 24 (+84.62%)
Mutual labels:  static-site-generator
wasp
A Static Site Generator written in Crystal.
Stars: ✭ 20 (+53.85%)
Mutual labels:  static-site-generator
hakyll-bootstrap
Basic Hakyll + Bootstrap site
Stars: ✭ 26 (+100%)
Mutual labels:  static-site-generator
voldemort
A simple static site generator using Jinja2 and Markdown templates.
Stars: ✭ 48 (+269.23%)
Mutual labels:  static-site-generator
presskit.html
Re-implementation of presskit() as a static site generator
Stars: ✭ 250 (+1823.08%)
Mutual labels:  static-site-generator
nuxt-starter-netlify-cms
Example nuxt + netlify cms project. Nuxt port of Gatsby starter app.
Stars: ✭ 13 (+0%)
Mutual labels:  static-site-generator
hugo-initio
Hugo Theme port of Initio bootstrap template by GetTemplate
Stars: ✭ 58 (+346.15%)
Mutual labels:  static-site-generator
moul
The minimalist publishing tool for photographers
Stars: ✭ 147 (+1030.77%)
Mutual labels:  static-site-generator

NOCMS

"NO, You don't need a CMS" is what you are going to tell your boss the next time he comes running waving his arms and yelling incomprehensibly about some new microsite for his wife's pony he wants to make in drupal, wordpress or any of the 1 billion other "let's stuff all your content in a mysql database and front it with some 10 year old php scripts" things that pop up in your facebook feed disguised as content.

Build Status NPM Version

Install

$ npm install nocms --save

Plugins by @debitoor

CLI Usage

Compile

Compiles all resources in the input directory and writes them to the output directory.

$ nocms compile --in-dir ./src/ --out-dir ./compiled/

Server

Runs a webserver on the port given and compiles resources in the input directory and writes them to the output directory before serving them to the user.

$ nocms server --in-dir ./src/ --out-dir ./compiled/ --port 1234

NOCMS is multithreaded and spins of one worker instance for each cpu as reported by os.cpus().

Plugins

A Plugin is any module that exports an activate function that when invoked registers one or more providers.

export function activate (pluginActivationContext)

Plugins installed in node_modules will be activated automatically.

pluginActivationContext

The plugin activation context gives plugins access to provider registration and to IO functions bound to the input and output directories.

  • findFiles
  • readFile
  • registerResourceProvider
  • watchFiles
  • writeFile

findFiles

Finds files relative to the input directory. Returns a Promise that resolves with an Array of file paths relative to the input directory.

async function findFiles (pattern, options)

Parameters:

  • pattern: Glob pattern,
  • options: Glob options

readFile

Asynchronously reads the contents of a file relative to the input directory. Returns a Promise that resolves with the contents of the file, a String or a Buffer.

async function readFile (file, options)

Parameters:

  • file: File path relative to the input directory
  • options: Same as when calling fs.readFile

registerResourceProvider

Registers a resource provider with NOCMS. See Resource Provider.

function registerResourceProvider (resourceProvider)

Parameters:

  • resourceProvider: An instance of a resource provider

watchFiles

Watches files relative to the input directory. Returns a chokidar instance.

function watchFiles (pattern, options)

Parameters:

  • pattern: Glob pattern
  • options: Chokidar options

writeFile

Asynchronously writes a file to the output directory. Automatically creates any missing parts of the file path before writing the file. Returns a promise.

async function writeFile (file, data, options) {}

Parameters:

  • file: file path relative to the output directory.
  • data: String or Buffer
  • options: Same as fs.writeFile

Example:

let html = '<html></html>';
await writeFile('index.html', html, 'utf8');

Resource Provider

Resource Providers are responsible for collecting meta data for, and compiling resources. A resource provider has two functions:

getResources

Asynchronously provides an Array of resource objects. A resource must as a minimum have an id field.

async function getResources ()

compileResource

Asynchronously compiles a resource object and writes the result to the file system. Returns a Promise that resolves with undefined.

async function compileResource (resource, resourceCompilationContext)

Parameters:

  • resource: a resource object
  • resourceCompilationContext: a resource compilation context.

Resource Compilation Context

The resource compilation context is an object with two fields.

  • resourceMap: a id/resource map of all resources from all resource providers
  • resourceTree: a resource tree of all resources from all resource providers

The resource compilation context can be used to provide resource meta data to templates during compilation.

Config

Configurations can be written in a .nocmsrc file at the root of the project, and will be served as json to plugins.

Develop

Bootstrap

Run lerna bootstrap

$ npm run bootstrap

Build

$ npm run build

Test

$ npm test

The end to end tests (rather integration than e2e) are in the root of the project in example-sites and make use of lerna to link the local modules, so if they are built, they are immediately tested as the newest version, as they are a symlink.

The expected rendered HTML/CSS/JS will be compared to the actually produced output.

License

MIT License

Copyright (c) 2017 Debitoor

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].