From cfca2de4677e7e288399f3848a52008a56844959 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Wed, 22 Jan 2025 22:54:29 +0100 Subject: [PATCH] Use md files for content --- index.lisp | 89 ++++++++++++++++++++++++++----------------------- introduction.md | 1 + news.md | 1 + 3 files changed, 50 insertions(+), 41 deletions(-) create mode 100644 introduction.md create mode 100644 news.md diff --git a/index.lisp b/index.lisp index f38979b..054ed0b 100644 --- a/index.lisp +++ b/index.lisp @@ -1,7 +1,7 @@ ;;; -*- mode: lisp; coding: utf-8; -*- ;;; Generate the index.html file -(ql:quickload :dev.metalisp.sbt) +(ql:quickload '(:dev.metalisp.sbt :3bmd)) (defpackage :website (:use :cl #:ml-sbt) @@ -21,53 +21,60 @@ (in-package :website) -(setf ml-sbt/navbar:*brand-name* "metalisp") +(defvar *lang* "en") -(with-open-file (ofile #P"index.html" :direction :output :if-exists :supersede) +(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))) + +(with-open-file (ofile #P"public/index.html" :direction :output :if-exists :supersede) (let ((html (with-page (:title "metalisp.dev projects") - (body-header nil "Crafting Software with the Power of Lisp and Scheme" - (with-navbar nil nil "Home" "/")) - (body-main nil + (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") - (:p "Hi, I'm Marcus, and metalisp.dev is where I share my passion for software development in Common Lisp, Emacs Lisp, and Guile Scheme. - This site features a variety of projects that demonstrate the unique capabilities of these languages.")) + (: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 - (with-card* - :card-header "ml-sbt" - :card-items '("Library of Common Lisp Macros to generate HTML using Bootstrap CSS." - "In Active Development") - :card-body (btn (:url "https://code.metalisp.dev/marcuskammer/dev.metalisp.sbt") - (t9n "view-details"))) - (with-card* - :card-header "ml-survey" - :card-items '("Create questionnaires and analyze the results." - "In Active Development") - :card-body (btn (:url "https://code.metalisp.dev/marcuskammer/dev.metalisp.survey") - (t9n "view-details"))) - (with-card* - :card-header "ml-qmetrics" - :card-items '("Calculation engine for questionnaires." - "In Active Development") - :card-body (btn (:url "https://code.metalisp.dev/marcuskammer/dev.metalisp.qmetrics") - (t9n "view-details"))) - (with-card* - :card-header "ml-activitystreams" - :card-items '("ActivityStreams 2 library" - "In Active Development") - :card-body (btn (:url "https://code.metalisp.dev/marcuskammer/dev.metalisp.activitystreams") - (t9n "view-details"))) - (with-card* - :card-header "emacs dot files" - :card-items '("Personal emacs dot files." - "In Active Development") - :card-body (btn (:url "https://code.metalisp.dev/marcuskammer/emacs.d") - (t9n "view-details"))))) + (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 (with-section (with-title-bar "Contact") - (:a :rel "me" - :href "https://fosstodon.org/@metalisp" - :class "hidden" "Mastodon")))))) + (with-list-group '(("email: post at metalisp.dev") + ("jabber groupchat: metalisp@conference.mailbox.org") + (:a :rel "me" :href "https://fosstodon.org/@metalisp" "Mastodon")))))))) (princ html ofile))) diff --git a/introduction.md b/introduction.md new file mode 100644 index 0000000..a4cc791 --- /dev/null +++ b/introduction.md @@ -0,0 +1 @@ +Hi, I'm Marcus, and metalisp.dev is where I share my passion for software development in Common Lisp, Emacs Lisp, and Guile Scheme. diff --git a/news.md b/news.md new file mode 100644 index 0000000..b8c6623 --- /dev/null +++ b/news.md @@ -0,0 +1 @@ +- 2025-01-22: I updated the [forgejo](https://code.metalisp.dev) instance to version 10.0.0