commit 632728767d80e8ec81c958bb61aa12885b8aa60f
parent 2546858f6901d7b206f204a7936924e61f29bf25
Author: Decay <decay@todayiwilllaunchmyinfantsonintoorbit.com>
Date: Tue, 29 Nov 2022 08:33:18 -0800
Refactor to allow a post ID to be plumbed through the content
Not plumbing such IDs through yet but this step will allow it.
This could do with some simplifcation in general so that if I have
to add another field (changing from '(YEAR MONTH CONTENT) to
'(YEAR MONTH ID CONTENT) in this case I don't ahve to touch so much.
Diffstat:
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/src/content.lisp b/src/content.lisp
@@ -195,7 +195,7 @@
:archive-date-list archive-date-list
:twitter-card twitter-card
:enable-rss enable-rss))
- (next-page-entry (list :page path next-page-content))
+ (next-page-entry (list :page path nil next-page-content))
(queue-rest (cdr queue))
(queue-new (with-paths path (getf next-page :children))))
(gen-pages-recur (append generated (cons next-page-entry nil))
@@ -224,12 +224,12 @@
(rss-content (gen-rss-feed entries
:generator rss-generator)))
(append (list
- (list :rss nil rss-content)
- (list :index nil (gen-index entries pages
- :twitter-card twitter-card
- :enable-rss rss-content
- :archive-date-list archive-date-list
- :generator generator)))
+ (list :rss nil nil rss-content)
+ (list :index nil nil (gen-index entries pages
+ :twitter-card twitter-card
+ :enable-rss rss-content
+ :archive-date-list archive-date-list
+ :generator generator)))
(gen-all-pages pages
:archive-date-list archive-date-list
:generator page-generator
@@ -274,7 +274,7 @@
(rest-entries (cdr collected)))
(cons
(if month-entries
- (list year month
+ (list year month nil
(funcall (or generator (make-generator))
month-entries pages
:year year
diff --git a/src/miniblog.lisp b/src/miniblog.lisp
@@ -161,7 +161,7 @@
(format t "Regenerating ~a...~%" description)
(ensure-directories-exist path)
(let ((year (nth 0 entry))
- (content (nth 2 entry)))
+ (content (nth 3 entry)))
(if (and (eql year :rss) (null content))
(format t "Can't generate valid RSS feed, skipping...~%")
(with-open-file (output path :direction :output :if-exists :supersede)
@@ -172,8 +172,8 @@
(let ((rss-content (miniblog.content:gen-rss-feed entries
:generator *rss-generator*))
(pages (miniblog.data:get-pages)))
- (regenerate-file (list :rss nil rss-content))
- (regenerate-file (list :index nil
+ (regenerate-file (list :rss nil nil rss-content))
+ (regenerate-file (list :index nil nil
(miniblog.content:gen-index entries pages
:enable-rss rss-content
:twitter-card *twitter-card*
@@ -189,7 +189,7 @@
(archive-date-list (miniblog.content:get-archive-date-list entries))
(rss-content (miniblog.content:gen-rss-feed entries
:generator *rss-generator*)))
- (regenerate-file (list :page parent-path
+ (regenerate-file (list :page parent-path nil
(miniblog.content:gen-page subtree-root
parent-path
pages
@@ -199,8 +199,7 @@
:archive-date-list archive-date-list)))
(loop for page in (getf subtree-root :children)
do (let ((path (append parent-path (list (getf page :name)))))
- (regenerate-file (list :page
- path
+ (regenerate-file (list :page path nil
(miniblog.content:gen-page
page path pages
:enable-rss rss-content