Static site generator
- Common Lisp 95.1%
- Makefile 4.9%
| .gitignore | ||
| dev.metalisp.ssg.asd | ||
| LICENSE | ||
| Makefile | ||
| ml-ssg.lisp | ||
| README.org | ||
dev.metalisp.ssg
Introduction
This repository includes source code written in Common Lisp which is a static site generator which fulfills my personal needs. My motivation to develop this static site generator was to manage content for my website https://www.metalisp.dev
What I need is maximum flexibility for defining the structure of pages. Most of the static site generators out there are focus to a specific domain for example documentations or weblogs.
How does it work?
@startuml
actor "User" as User
participant "main" as Main
participant "read-site-configurations" as ReadConfig
participant "with-read-file" as ReadFile
participant "make-site*" as MakeSite
participant "site-build" as SiteBuild
participant "File System" as FS
User -> Main
activate Main
Main -> ReadConfig : (read-site-configurations "sites.lisp")
activate ReadConfig
ReadConfig -> ReadFile : (with-read-file (in pathname) ...)
activate ReadFile
ReadFile -> FS : (uiop:with-input-file (in pathname))
activate FS
FS --> ReadFile : file stream
deactivate FS
ReadFile -> ReadConfig : (read in)
deactivate ReadFile
ReadConfig --> Main : list of site configurations
deactivate ReadConfig
loop for each site configuration
Main -> MakeSite : (make-site* config)
activate MakeSite
MakeSite --> Main : site object
deactivate MakeSite
Main -> SiteBuild : (site-build site)
activate SiteBuild
SiteBuild --> Main : HTML output
deactivate SiteBuild
end
Main --> User : Exit
deactivate Main
@enduml
ml-ssg
When you run the ml-ssg binary it is looking for a sites.lisp file (See: 1) in the same directory it is called.
((:name "main"
;; name the site
:url "https://www.metalisp.dev/"
;; the url of the site
:content-directory "content/"
;; this directory includes markdown files. It is relative to the directory ml-ssq is called in.
:build-directory "public/"
;; The directory where HTML is generated to. It is relative to the directory ml-ssg is called in.
:pages-data-file "main-de-pages.lisp"
;; A lisp file which includes pages definitions.
))
sites.lisp file