poise
An LFE Library for the Framework-agnostic Generation of Static HTML Content
Contents
About ↟
poise, n. 1
- a stably balanced state; equilibrium
- 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 optionsgenerate- 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

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

