From 3109a03d52192f65ac0ca05f52a7d4913d015d76 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Wed, 9 Aug 2023 14:12:34 +0200 Subject: [PATCH] Update with-page api --- examples/album.lisp | 2 +- src/main.lisp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/album.lisp b/examples/album.lisp index 3962a2c..1326443 100644 --- a/examples/album.lisp +++ b/examples/album.lisp @@ -205,7 +205,7 @@ The footer contains a copyright notice. All of these components are customizable by providing different arguments to the respective component macros." - `(with-page (:cdn ,cdn :title ,title) + `(with-page (:author "Marcus Kammer" :description "Album Page" :cdn ,cdn :pagetitle ,title) (navigation (col (:breakpoint (:kind :col :sm (8 nil) :md (7 nil)) :spacing (:property "p" :side "y" :size 4)) diff --git a/src/main.lisp b/src/main.lisp index 683227b..97d2186 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -10,14 +10,16 @@ (defparameter *cdn-css* "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css") (defparameter *cdn-js* "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js") -(defmacro with-page ((&key cdn title) &body body) +(defmacro with-page ((&key (author "") (description "") (cdn t) (pagetitle "")) &body body) `(spinneret:with-html (:doctype) (:html (:head (:meta :charset "utf-8") (:meta :name "viewport" :content "width=device-width, initial-scale=1") - (:title ,title) + (:meta :name "author" :content ,author) + (:meta :name "description" :content ,description) + (:title ,pagetitle) (if ,cdn (:link :type "text/css" :rel "stylesheet" :href ,*cdn-css*) (:link :type "text/css" :rel "stylesheet" :href "5.3.0/bootstrap.min.css")))