Static sites generator
Find a file
2025-09-21 12:48:33 +02:00
src Extend page and site API 2025-09-21 12:47:59 +02:00
dev.metalisp.sites.asd Increase version number 2025-09-21 12:48:33 +02:00
README.org Update README 2025-09-17 09:10:51 +02:00

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