aboutsummaryrefslogtreecommitdiff
path: root/build-site.el
diff options
context:
space:
mode:
authorazureazure <azureazure@disroot.org>2025-12-31 21:57:35 +0100
committerazureazure <azureazure@disroot.org>2025-12-31 21:57:35 +0100
commit0921964e91709d8dd454235753c4554cdee3f7eb (patch)
treeab292d2464856e6bb4a2106b82bfd0560c6904ce /build-site.el
parentc2ccfcef07209a9fa6e049a5574471d62e34d33a (diff)
downloadslimegirl.nexus-0921964e91709d8dd454235753c4554cdee3f7eb.tar.gz
actually write something for once
Diffstat (limited to 'build-site.el')
-rw-r--r--build-site.el49
1 files changed, 28 insertions, 21 deletions
diff --git a/build-site.el b/build-site.el
index b834312..f4587c7 100644
--- a/build-site.el
+++ b/build-site.el
@@ -7,12 +7,11 @@
org-html-doctype "html5"
org-html-html5-fancy t
org-html-head-include-default-style nil
- ;; org-html-postamble nil
org-html-head (with-temp-buffer
(insert-file-contents "head.html")
(buffer-string)))
-(defun custom/sitemap-format-entry (entry style project)
+(defun my/sitemap-format-entry (entry style project)
(let ((filename (org-publish-find-title entry project))
(date (org-publish-find-date entry project)))
(format "%s - [[file:%s][%s]]"
@@ -20,7 +19,12 @@
entry
filename)))
-(defun custom/body-query (html-file &optional url with-toc)
+(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)))
@@ -31,12 +35,25 @@
(setq org-publish-project-alist
(list
+ (list "blog"
+ :recursive t
+ :base-directory "./src/blog"
+ :publishing-directory "./public/blog"
+ :publishing-function 'org-html-publish-to-html
+ :section-numbers nil
+ :with-toc nil
+ :auto-sitemap t
+ :time-stamp-file nil
+ :sitemap-title "Lemurblog"
+ :sitemap-filename "index.org"
+ :sitemap-sort-files 'anti-chronologically
+ :sitemap-format-entry 'my/sitemap-format-entry
+ :sitemap-function 'my/sitemap-function)
(list "pages"
:recursive nil
:base-directory "./src"
:publishing-function 'org-html-publish-to-html
:publishing-directory "./public"
- ;; :with-title nil
:with-toc nil
:html-postamble nil
:section-numbers nil
@@ -46,34 +63,24 @@
:base-directory "./src/assets"
:base-extension 'any
:publishing-function 'org-publish-attachment
- :publishing-directory "./public/assets")
- (list "blog"
- :recursive t
- :base-directory "./src/blog"
- :publishing-directory "./public/blog"
- :publishing-function 'org-html-publish-to-html
- :section-numbers nil
- :with-toc nil
- :auto-sitemap t
- :time-stamp-file nil
- :sitemap-title "Blog posts"
- :sitemap-filename "index.org"
- :sitemap-sort-files 'anti-chronologically
- :sitemap-format-entry 'custom/sitemap-format-entry)))
+ :publishing-directory "./public/assets")))
(delete-directory "public" :recursive t)
(org-publish-all t)
-(let ((webfeeder-body-function 'custom/body-query))
+(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
- :title "lemurblog"
+ (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))