Giter VIP home page Giter VIP logo

stencil's Introduction

Stencil

Stencil is a simple static site generator written in python that aims to provide simple abstractions to make building websites easier

Where other static site generators bludgeon their users into developing blog-like websites, stencil gives users complete control of what build artefacts are produced and how they are produced.

Configuration

Stencil is configured through a JSON config either passed as an argument to stencil build project with -c or through being read through stdin with -c -.

An example stencil config looks like...

{
    "content": [
        {
            "builder": "static",
            "source_directory": "./root-static",
            "output_directory": ""
        },
        {
            "builder": "template",
            "source_directory": "./root-pages",
            "output_directory": ""
        }
    ],
    "builders": {
        "static": {
            "flavor": "StaticBuilder",
            "config": {
                "symlink": true
            }
        },
        "template": {
            "flavor": "MarkdownBuilder",
            "config": {
                "template_directory": "./templates",
                "markdown_extensions": ["fenced_code"]
            }
        }
    },
    "variables": {
        "site_name": "mylesalamb.com"
    }
}

Content Entries

Content blocks describe where source artefacts live, relative to the current working directory, and where their outputs should be placed relative to the output directory argument.

Each stencil content block is associated with a named 'builder' which provides a build strategy for processing inputs to their associated ouptuts

Builder Entries

Builders provide a strategy/method for taking an input directory, performing some operation and placing the result in an output directory.

Building

The project ships with a makefile that makes developing against stencil easy. you can produce a development build of stencil with make dev, you can then run stencil with ./venv/bin/stencil

Installing

stencil can be installed through either a whl or through using the makefile to install to /opt

To build the project as a python wheel

make dev
make dist

Where the wheel is located in ./dist

To install to /opt you can run

make dev
make dist
sudo make install

Where you should then adjust your PATH like so export PATH=${PATH}:/opt/stencil/bin

Bumping dependencies

stencil is built against a contraints file that restricts the versions of dependencies that are installed with stencil, you can bump the dependencies in use with

make clean
> constraints.txt
make dev
./venv/bin/pip freeze --exclude-editable > constraints.txt

stencil's People

Contributors

mylesalamb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.