Skip to content

Schaltstelle/simple-site

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-site

Build Status codecov License

A simple website generator.

Usage

Install with npm install -g simple-site.

Run with simple-site build.

Function

Simple-site recursively processes all files in the current directory and outputs them into an output directory. Depending on the file extension, different actions take place.

  • *.md apply the contents to the given template (see below).
  • *.html apply possibly existing handlebar {{...}} tags.
  • all other files copied into the output directory without any processing.

Templating

A simple .md file looks like this:

title: Hello site!
author: Joe Doe
date: 2017-03-17
template: _templates/simple.html
---
Here some *markdown* content.

the corresponding template simple.html would be:

<body>
    <h1>{{title}}</h1>
    {{date}}, {{author}}
    <br>
    {{{content}} 
</body>

{{...}} are handlebars expressions which reference the data from the .md file.

Configuration

Configuration parameters can be defined on the command line simple-site build --outputDir=dist or in a file named _config.yaml. All parameters are available in handlebar tags. The following parameters exist:

outputDir The output directory. Default: output

exclude File patterns that should excluded from processing (by default all files starting with _ or . are already excluded).

watch When present, all files are watched and processed on change, the output directory is served on port 8111.

Plugins

All .js files in _plugins are read and processed at the begin of the process.