Home

Awesome

<h3 align="center"> <b>Currently not maintained! If you would like to resume maintenance, please open an issue!</b> </h3> <h1 align="center"> <img src="logo.gif" width="150" alt="awoo logo" /> </h1> <div align="center"> a general, lightweight framework for parsing loads of files </div> <div align="center"> <i>by extension, a static site generator</i> </div> <br /> <div align="center"> <!-- Stability --> <a href="https://nodejs.org/api/documentation.html#documentation_stability_index"> <img src="https://img.shields.io/badge/stability-stable-green.svg?style=flat-square" alt="API stability" /> </a> <!-- travis ci --> <a href="https://travis-ci.org/awoojs/awoo"> <img src="https://img.shields.io/travis/awoojs/awoo.svg?style=flat-square" alt="test status" /> </a> <!-- npm version --> <a href="https://npmjs.org/package/awoo"> <img src="https://img.shields.io/npm/v/awoo.svg?style=flat-square" alt="npm version" /> </a> <!-- package size --> <a href="https://packagephobia.now.sh/result?p=awoo"> <img src="https://packagephobia.now.sh/badge?p=awoo" alt="package size" /> </a> </div> <br />

Table of Contents

Features

Installation

You need Node.js 7.6 or higher.

npm install --save awoo

Example

Let's write a simple program that changes the content of all files in a directory to "hey, what's up":

const awoo = require('awoo')

// this is the simplest plugin you can build!
// conveniently, plugins are just normal functions
const plugin = () => {
  // replace all file contents with the string
  return files => files.map(file => {
    file.contents = `hey, what's up`
    return file
  })
}

// enter our main function:
// the main function should be an async function so that
// it automatically returns a promise
awoo(async site => {
  // we register our plugin...
  site.use(plugin)
  // ...and initiate the build process
  return site
})

Let's save this as example.js. To run it, you need Node.js version 7.6 or higher. The latest stable version will work.

node example.js

awoo doesn't output logs by default. If you want logs (for example, for debugging), you can set the DEBUG environment variable to:

awoo # for base logs
awoo:read # for specific read logs
awoo:write # for specific write logs

# you can also combine any of the three
awoo,awoo:read

To get all logs at once, you can just set the variable to awoo*.

DEBUG=awoo* node my_script # full logging!

awoo plugins may implement logging with different DEBUG names.

How does it work?

It's fairly simple! What awoo does can be split up into two things:

It's that simple! Static site generators aren't rocket science or whatever. If you got confused by looking at the Jekyll source code once, that's because Jekyll is more fully fledged than awoo is, that is, it provides some defaults.

But static site generators, at their core, are just programs that take a set of files, do something to them, and then output those files. That's it. The rest is just transformations on those files.

awoo's goal is to reduce that essence to its very base, and to give you a bunch of building blocks with which you can make your ideal site, using only the stuff you need!

API Documentation

The docs are published on our website.

Plugins

Official plugins are kept at awoojs/core!

Since it's really easy to write awoo plugins, anyone can make and publish one! If you make a plugin, you should add a GitHub topic awoo and probably also add awoo as a keyword in your package.json.

Here's a list of all awoo plugins on GitHub

Development

To work on this repository, clone it and install the npm dependencies:

git clone https://github.com/awoojs/awoo.git
cd awoo
npm install

There are a couple of npm scripts provided for convenience:

How does it compare?

This section is a little bit about how awoo compares to other static site generators (even though it isn't really that):

What dependencies does it have?

If you have any ideas as to how to eliminate a dependency, you're more than welcome to pitch it in a new issue!

Maintainers

Code of Conduct

This repository operates under the weallbehave Code of Conduct. Its contents can be found in CODE_OF_CONDUCT.md.

License

GNU AGPLv3 (see LICENSE document)