poise
An LFE Library for framework-agnostic generation of static HTML content
Contents
About ↟
<strong>poise</strong>- 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-2024, Duncan McGreggor
Apache License, Version 2.0
1