Update with-page api

This commit is contained in:
Marcus Kammer 2023-08-09 14:12:34 +02:00
parent 6bd1a443f3
commit 3109a03d52
2 changed files with 5 additions and 3 deletions

View file

@ -205,7 +205,7 @@ The footer contains a copyright notice.
All of these components are customizable by providing different arguments All of these components are customizable by providing different arguments
to the respective component macros." to the respective component macros."
`(with-page (:cdn ,cdn :title ,title) `(with-page (:author "Marcus Kammer" :description "Album Page" :cdn ,cdn :pagetitle ,title)
(navigation (navigation
(col (:breakpoint (:kind :col :sm (8 nil) :md (7 nil)) (col (:breakpoint (:kind :col :sm (8 nil) :md (7 nil))
:spacing (:property "p" :side "y" :size 4)) :spacing (:property "p" :side "y" :size 4))

View file

@ -10,14 +10,16 @@
(defparameter *cdn-css* "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css") (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") (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 `(spinneret:with-html
(:doctype) (:doctype)
(:html (:html
(:head (:head
(:meta :charset "utf-8") (:meta :charset "utf-8")
(:meta :name "viewport" :content "width=device-width, initial-scale=1") (: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 (if ,cdn
(:link :type "text/css" :rel "stylesheet" :href ,*cdn-css*) (:link :type "text/css" :rel "stylesheet" :href ,*cdn-css*)
(:link :type "text/css" :rel "stylesheet" :href "5.3.0/bootstrap.min.css"))) (:link :type "text/css" :rel "stylesheet" :href "5.3.0/bootstrap.min.css")))