aboutsummaryrefslogtreecommitdiff
path: root/build-site.el
diff options
context:
space:
mode:
Diffstat (limited to 'build-site.el')
-rw-r--r--build-site.el40
1 files changed, 10 insertions, 30 deletions
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!")