diff options
| author | azureazure <azureazure@disroot.org> | 2026-01-01 03:11:14 +0100 |
|---|---|---|
| committer | azureazure <azureazure@disroot.org> | 2026-01-01 03:11:14 +0100 |
| commit | 2436dd9e215249484010870f668f79fdf8456d7e (patch) | |
| tree | 91499aa3225e592d2083c65f496e256b9d32b63b | |
| parent | 0921964e91709d8dd454235753c4554cdee3f7eb (diff) | |
| download | slimegirl.nexus-2436dd9e215249484010870f668f79fdf8456d7e.tar.gz | |
simplify rss generation
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | build-site.el | 40 |
2 files changed, 12 insertions, 30 deletions
@@ -1,4 +1,6 @@ # autogenerated sitemap /src/blog/index.org +# generated rss feed +/src/blog/rss.xml API_KEY /public/ diff --git a/build-site.el b/build-site.el index f4587c7..242786b 100644 --- a/build-site.el +++ b/build-site.el @@ -1,6 +1,6 @@ (package-initialize) (require 'ox-publish) -(require 'webfeeder) +(require 'org-publish-rss) (setq org-html-validation-link nil org-html-head-include-scripts nil @@ -22,23 +22,13 @@ (defun my/sitemap-function (title list) ; todo change this (org-publish-sitemap-default title list)) -(defun my/body-query (html-file &optional _url _with-toc) - "Replaces the <description> tag in the RSS output with the contents of <meta name=description>. -Arguments beginning with _ are required for the function to work but are unused." - (with-temp-buffer - (insert-file-contents html-file) - (let* ((dom (libxml-parse-html-region (point-min) (point-max))) - (meta-tags (dom-by-tag dom 'meta))) - (cl-loop for (_meta ((_ . name-value) (_ . content-value))) in meta-tags - when (string= name-value "description") - return content-value)))) - (setq org-publish-project-alist (list (list "blog" :recursive t :base-directory "./src/blog" :publishing-directory "./public/blog" + :base-extension "org" :publishing-function 'org-html-publish-to-html :section-numbers nil :with-toc nil @@ -48,7 +38,12 @@ Arguments beginning with _ are required for the function to work but are unused. :sitemap-filename "index.org" :sitemap-sort-files 'anti-chronologically :sitemap-format-entry 'my/sitemap-format-entry - :sitemap-function 'my/sitemap-function) + :sitemap-function 'my/sitemap-function + :auto-rss t + :rss-description "The Lemurian Mage's Awesome Lemur Blog" + :rss-link "https://lemurianmage.srht.site/blog" + :rss-copyright "nah" + :completion-function 'org-publish-rss) (list "pages" :recursive nil :base-directory "./src" @@ -62,27 +57,12 @@ Arguments beginning with _ are required for the function to work but are unused. :recursive t :base-directory "./src/assets" :base-extension 'any + :include '("../blog/rss.xml") :publishing-function 'org-publish-attachment :publishing-directory "./public/assets"))) (delete-directory "public" :recursive t) - +(setenv "TZ" "UTC0") ; remove the timezone from rss output (org-publish-all t) -(let ((webfeeder-body-function 'my/body-query)) - (setenv "TZ" "UTC0") ; remove the timezone from webfeeder output - (webfeeder-build - "rss.xml" - "./public/blog" - "https://lemurianmage.srht.site" - (seq-filter - (lambda (x) (not (or (file-directory-p x) (string= x "index.html")))) - (directory-files "public/blog")) ; no ".", "..", and index.html - :author "The Lemurian Mage" - :title "Lemurblog" - :generator "The Lemurian Mage's Little Lemur Hands" - :builder 'webfeeder-make-rss - :build-date 0)) - - (message "Build done!") |
