mirror of github:amycatgirl/amycatgirl.github.io
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: make get-in macro generic, make html gen more robust

Also removes the publish function as this script will just run once
everything has been evaluated.

Signed-off-by: Amy <amy+git@amogus.cloud>

Amy 9d15c74e a2e0638d

+9 -10
+9 -10
fallback.lisp
··· 17 17 (defun keywordize (name) 18 18 (intern (string-upcase name) "KEYWORD")) 19 19 20 - (defmacro get-in-plist (place indicators) 20 + (defmacro get-in (place indicators &key (accessor-fn 'getf)) 21 21 (let ((rev-indicators (reverse indicators))) 22 22 (labels ((construct (y ys) (cond 23 - ((null ys) (list 'getf place y)) 24 - (t (list 'getf (construct (car ys) (cdr ys)) y))))) 23 + ((null ys) (list accessor-fn place y)) 24 + (t (list accessor-fn (construct (car ys) (cdr ys)) y))))) 25 25 (construct (car rev-indicators) (cdr rev-indicators))))) 26 26 27 27 ;; Git ··· 103 103 (:hour 2) #\: (:min 2))))))) 104 104 105 105 (defun entry-element (entry) 106 - (let ((title (get-in-plist entry (:value :title))) 107 - (description (or (get-in-plist entry (:value :description)) "")) 108 - (date (get-in-plist entry (:value :publishedat))) 109 - (link "todo")) 106 + (let ((title (get-in entry (:value :title))) 107 + (description (or (get-in entry (:value :description)) "")) 108 + (date (get-in entry (:value :publishedat))) 109 + (link "todo") 110 + (spinneret:*html-style* :tree)) 110 111 (spinneret:with-html-string 111 112 (:div.entry 112 113 (:a.base-anchor :href link ··· 116 117 (published-at-element date)))))) 117 118 118 119 (defun generate-html (entries) 119 - (mapcar #'entry-element entries)) 120 - 121 - (defun publish ()) 120 + (format nil "~{~A~^\n~}" (mapcar #'entry-element entries)))