The Wayback Machine - https://web.archive.org/web/20201026005348/https://github.com/lfex/poise
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

poise

Build Status LFE Versions Erlang Versions Tags Downloads

An LFE Library for the Framework-agnostic Generation of Static HTML Content

Contents

About

poise, n. 1

  1. a stably balanced state; equilibrium
  2. easy self-possessed assurance of manner; gracious tact in coping or handling; the pleasantly tranquil interaction between persons of poise; a particular way of carrying oneself; bearing, carriage

poise aims to be as simple and unopinionated solution as possible to the problem of generating static site content in the LFE/Erlang/BEAM world of web development. It boils down to two primary operations:

  • make-site - a record consturctor that takes a site data structure and content-generation related options
  • generate - a function that iterates through the paths and functions in the site data structure, saving them to a conifigured output directory

The poise LFE library is inspired by the Clojure statis project which accomplishes the same goals for the Clojure ecosystem.

Usage

NOTE: This is a new project in an alpha release. Please test and submit tickets!

Site Definition

Definte a site:

(include-lib "poise/include/poise.lfe")

(make-site
  routes (list
           (make-route path "index.html"
                       func (lambda () (index-page)))
           (make-route path "about.html"
                       func (lambda () (about-page))))
  opts (make-options output-dir "static"))

There is a convenience function provided that makes this easier (and is thus the recommended approach):

(poise:site
  `(("index.html" ,#'index-page/0)))
    ("about.html" ,#'about-page/0))))
  #m(output-dir "static"))

In both of the above cases, you'd want to assign the results to a variable, e.g., site-data.

Static Content Generation

Generate the site:

(poise:generate site-data)

That's it!

Additional Features

TBD (See upcoming feature tickets)

License

Copyright © 2017, Duncan McGreggor

Apache License, Version 2.0


1 https://www.merriam-webster.com/dictionary/poise

About

An LFE Library for the Framework-agnostic Generation of Static HTML Content

Topics

Resources

License

Packages

No packages published
You can’t perform that action at this time.