Static sites generator
src | ||
dev.metalisp.sites.asd | ||
README.org |
dev.metalisp.sites
Library to write static site/pages generators, written in Common Lisp.
How to use?
Create a file which describes your site e.g. sites.lisp
:
((:name "main"
:url "https://www.metalisp.dev/"
:content-directory "content/"
:build-directory "public/"
:pages-data-file "main-de-pages.lisp"))
Create the lisp file for :pages-data-file
which includes the pages for your site:
((:name "index"
:html-title "meta.lisp - Software that thinks with you."
:html-description "meta.lisp - Simple, durable software for small businesses. No lock-in, no bullshit. Climate-neutral and secure."
:language "en"
:select-languages (("de" "/index.html" "Deutsch")
("en" "/en/index.html" "English"))
:template (lambda (page)
(with-page (:title (page-html-title page))
(:p "Hello World")))))
Then create the lisp file e.g. main.lisp
which is called to build the pages:
(defun build-sites (sites)
(loop :for site in sites
:do (site-ensure-directories site)
(site-add-pages site)
(site-build-pages site)))
(defun main ()
(let ((sites (with-open-file (ifile "sites.lisp")
(mapcar #'make-site* (read ifile)))))
(build-sites sites)))
(main)
License
MIT License