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

Configure Feed

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

feat: generate html using spinneret

Datetime parsing is done by local-time. Last thing to do is to safely
replace the noscript block in the index.html file.

Emacs made this easy because it works with buffers directly, so
modifying files was trivial. However, this is not the case with common lisp.

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

Amy a2e0638d 15aa4063

+23 -3
+23 -3
fallback.lisp
··· 95 95 :limit maximum))) 96 96 97 97 ;; Generator 98 - (defun build-elements-from-entries (entries)) 99 - (defun sort-entries-by-date (entries)) 100 - (defun generate-html ()) 98 + (defun published-at-element (date) 99 + (let ((time (local-time:parse-timestring date))) 100 + (spinneret:with-html 101 + (:time.published-at :attrs (list :datetime date) 102 + (local-time:format-timestring nil time :format '((:day 2) "/" (:month 2) "/" :year ", " 103 + (:hour 2) #\: (:min 2))))))) 104 + 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")) 110 + (spinneret:with-html-string 111 + (:div.entry 112 + (:a.base-anchor :href link 113 + (:h3.title title)) 114 + (:p.description description) 115 + (:div.metadata 116 + (published-at-element date)))))) 117 + 118 + (defun generate-html (entries) 119 + (mapcar #'entry-element entries)) 120 + 101 121 (defun publish ())