2024-12-28 16:58:14 +01:00
|
|
|
;;; -*- mode: lisp; coding: utf-8; -*-
|
|
|
|
;;; Generate the index.html file
|
|
|
|
|
2025-01-22 22:54:29 +01:00
|
|
|
(ql:quickload '(:dev.metalisp.sbt :3bmd))
|
2024-12-28 16:58:14 +01:00
|
|
|
|
|
|
|
(defpackage :website
|
|
|
|
(:use :cl #:ml-sbt)
|
|
|
|
(:import-from #:ml-sbt/section
|
|
|
|
#:with-section
|
|
|
|
#:with-section-row
|
|
|
|
#:with-section-col
|
|
|
|
#:with-title-bar)
|
|
|
|
(:import-from #:ml-sbt/navbar
|
|
|
|
#:with-navbar)
|
|
|
|
(:import-from #:ml-sbt/list-group
|
2025-01-23 16:06:39 +01:00
|
|
|
#:list-group
|
|
|
|
#:with-list-group
|
|
|
|
#:with-list-group*)
|
2024-12-28 16:58:14 +01:00
|
|
|
(:import-from #:ml-sbt/card
|
|
|
|
#:with-card*)
|
|
|
|
(:import-from #:ml-sbt/btn
|
|
|
|
#:btn))
|
|
|
|
|
|
|
|
(in-package :website)
|
|
|
|
|
2025-01-22 22:54:29 +01:00
|
|
|
(defvar *lang* "en")
|
2024-12-28 16:58:14 +01:00
|
|
|
|
2025-01-22 22:54:29 +01:00
|
|
|
(defparameter *active-projects*
|
2025-01-23 16:06:39 +01:00
|
|
|
'(("metalisp.sbt"
|
|
|
|
("Library of Common Lisp Macros to generate HTML." "In Active Development" "Common Lisp")
|
|
|
|
"https://code.metalisp.dev/marcuskammer/dev.metalisp.sbt")
|
|
|
|
("metalisp.survey"
|
|
|
|
("Create questionnaires and analyze the results." "In Active Development" "Common Lisp")
|
|
|
|
"https://code.metalisp.dev/marcuskammer/dev.metalisp.survey")
|
|
|
|
("metalisp.qmetrics"
|
|
|
|
("Calculation engine for questionnaires." "In Active Development" "Common Lisp")
|
|
|
|
"https://code.metalisp.dev/marcuskammer/dev.metalisp.qmetrics")
|
|
|
|
("metalisp.activitystreams"
|
|
|
|
("ActivityStreams 2 library" "In Active Development" "Common Lisp")
|
|
|
|
"https://code.metalisp.dev/marcuskammer/dev.metalisp.activitystreams")
|
|
|
|
("emacs dot files"
|
|
|
|
("Personal emacs dot files." "In Active Development" "Emacs Lisp")
|
|
|
|
"https://code.metalisp.dev/marcuskammer/emacs.d")))
|
2025-01-22 22:54:29 +01:00
|
|
|
|
|
|
|
(defun md-to-html-string (markdown-string)
|
|
|
|
(with-output-to-string (s)
|
|
|
|
(3bmd:parse-string-and-print-to-stream markdown-string s)))
|
|
|
|
|
|
|
|
(defun md-file-to-html-string (input-file)
|
|
|
|
(with-output-to-string (s)
|
|
|
|
(3bmd:parse-and-print-to-stream input-file s)))
|
|
|
|
|
2025-01-23 16:06:39 +01:00
|
|
|
(unless (uiop:directory-exists-p #P"public/")
|
|
|
|
(uiop:ensure-all-directories-exist '(#P"public/")))
|
|
|
|
|
|
|
|
(defparameter *index-html*
|
|
|
|
(with-page (:title "metalisp.dev projects")
|
|
|
|
(with-body-header nil "Crafting Software with the Power of Lisp" *lang*
|
|
|
|
(with-navbar nil "metalisp" "/" nil nil))
|
|
|
|
(with-body-main nil
|
|
|
|
;; Introduction
|
|
|
|
(with-section
|
|
|
|
(with-title-bar "About metalisp")
|
|
|
|
(:raw (md-file-to-html-string "introduction.md")))
|
|
|
|
;; News
|
|
|
|
(with-section
|
|
|
|
(with-title-bar "News")
|
|
|
|
(:raw (md-file-to-html-string "news.md")))
|
|
|
|
;; Active Projects
|
|
|
|
(with-section
|
|
|
|
(with-title-bar "Active Projects")
|
|
|
|
(with-section-row
|
|
|
|
(dolist (project *active-projects*)
|
|
|
|
(destructuring-bind (cheader citems curl) project
|
|
|
|
(with-card*
|
|
|
|
:card-header cheader
|
|
|
|
:card-items citems
|
|
|
|
:card-body (btn (:url curl) (t9n "view-details" *lang*)))))))
|
|
|
|
;; Contact
|
|
|
|
(with-section
|
|
|
|
(with-title-bar "Contact")
|
|
|
|
(with-list-group nil
|
|
|
|
"email: post at metalisp.dev"
|
|
|
|
"jabber chatgroup: metalisp@conference.mailbox.org"
|
|
|
|
(:a :rel "me" :href "https://fosstodon.org/@metalisp" "Mastodon"))))))
|
|
|
|
|
2025-01-23 00:24:29 +01:00
|
|
|
(with-open-file (ofile "public/index.html" :direction :output :if-exists :supersede)
|
2025-01-23 16:06:39 +01:00
|
|
|
(princ *index-html* ofile))
|