www.metalisp.dev/index.lisp

81 lines
3.4 KiB
Common Lisp
Raw Normal View History

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
#:with-list-group)
(: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*
'((:header "metalisp.sbt"
:items ("Library of Common Lisp Macros to generate HTML for Bootstrap CSS." "In Active Development" "Common Lisp")
:url "https://code.metalisp.dev/marcuskammer/dev.metalisp.sbt")
(:header "metalisp.survey"
:items ("Create questionnaires and analyze the results." "In Active Development" "Common Lisp")
:url "https://code.metalisp.dev/marcuskammer/dev.metalisp.survey")
(:header "metalisp.qmetrics"
:items ("Calculation engine for questionnaires." "In Active Development" "Common Lisp")
:url "https://code.metalisp.dev/marcuskammer/dev.metalisp.qmetrics")
(:header "metalisp.activitystreams"
:items ("ActivityStreams 2 library" "In Active Development" "Common Lisp")
:url "https://code.metalisp.dev/marcuskammer/dev.metalisp.activitystreams")
(:header "emacs dot files"
:items ("Personal emacs dot files." "In Active Development" "Emacs Lisp")
:url "https://code.metalisp.dev/marcuskammer/emacs.d")))
(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 00:24:29 +01:00
(with-open-file (ofile "public/index.html" :direction :output :if-exists :supersede)
2024-12-28 16:58:14 +01:00
(let ((html (with-page (:title "metalisp.dev projects")
2025-01-22 22:54:29 +01:00
(with-body-header nil "Crafting Software with the Power of Lisp" *lang*
(with-navbar nil "metalisp" "/" nil nil))
(with-body-main nil
;; Introduction
2024-12-28 16:58:14 +01:00
(with-section
(with-title-bar "About metalisp")
2025-01-22 22:54:29 +01:00
(: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
2024-12-28 16:58:14 +01:00
(with-section
(with-title-bar "Active Projects")
(with-section-row
2025-01-22 22:54:29 +01:00
(dolist (project *active-projects*)
(with-card*
:card-header (getf project :header)
:card-items (getf project :items)
:card-body (btn (:url (getf project :url))
(t9n "view-details" *lang*))))))
;; Contact
2024-12-28 16:58:14 +01:00
(with-section
(with-title-bar "Contact")
2025-01-22 22:54:29 +01:00
(with-list-group '(("email: post at metalisp.dev")
("jabber groupchat: metalisp@conference.mailbox.org")
(:a :rel "me" :href "https://fosstodon.org/@metalisp" "Mastodon"))))))))
2024-12-28 16:58:14 +01:00
(princ html ofile)))