From 372278160939f3119c273dd968a7f0a40a95bd3d Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Fri, 22 Dec 2023 14:43:26 +0800 Subject: [PATCH] Nog steeds 2 rss.org bestanden... --- maak-website.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/maak-website.el b/maak-website.el index 4cc1f9a..b5c8826 100644 --- a/maak-website.el +++ b/maak-website.el @@ -1,5 +1,5 @@ (require 'ox-publish) -;(require 'ox-rss) +(require 'ox-rss) (load "~/.emacs.d/lisp/mustache-html.el") (setq org-html-doctype "html5") @@ -120,7 +120,7 @@ Either the section between #+BEGIN_PREVIEW and +#END_PREVIEW is used, or the fir (defun my-blog-sitemap (title list) "Generate the sitemap landing page for my blog." (my-plain-publish-sitemap-default title list) ; Create additional sitemap - ;(my-blog-publish-rss-sitemap title list) ; Create RSS sitemap + (my-blog-publish-rss-sitemap title list) ; Create RSS sitemap (with-temp-buffer ;; mangle the parsed list given to us into a plain lisp list of files (let* ((filenames (my-blog-parse-sitemap-list list)) @@ -186,28 +186,30 @@ representation for the files to include, as returned by `org-list-to-lisp'." (with-temp-buffer (message "Creating RSS index.") + (org-mode) (let* ((filenames (my-blog-parse-sitemap-list list)) (project-plist (assoc "posts" org-publish-project-alist)) ;;(articles (my-blog-sort-article-list filenames project-plist)) ) - (org-mode) (insert "#+AUTHOR: Frederik Vanrenterghem\n") (dolist (file filenames) (unless (eq (file-name-base file) "rss.org") + (message "Processing %s for RSS index." file) (let* ((abspath (file-name-concat "/home/frederik/websites/stage.vanrenterghem.biz/source/posts" file)) (relpath (file-relative-name abspath "/home/frederik/websites/stage.vanrenterghem.biz/source/")) (title (org-publish-find-title file project-plist)) (date (format-time-string (car org-time-stamp-custom-formats) (org-publish-find-date file project-plist))) (rss-permalink (file-name-sans-extension relpath)) (preview (my-blog-get-preview abspath))) - (insert (concat "* [[file:" relpath "][" title "]]\n")) + (insert (concat "* [[file:" relpath "][" title "]]")) (org-set-property "RSS_PERMALINK" rss-permalink) (org-set-property "PUBDATE" date) (org-set-property "RSS_TITLE" title) - (insert preview)))) + (insert preview) + (insert "\n")))) (goto-char (point-min)) - (insert "#+OPTIONS: ^:nil\n") - (write-file "~/websites/stage.vanrenterghem.biz/source/posts/rss.org")))) + (insert "#+OPTIONS: ^:nil\n")) + (write-file "~/websites/stage.vanrenterghem.biz/source/posts/rss.org"))) (defun my-blog-cleanup-sitemaps (plist) @@ -309,3 +311,5 @@ representation for the files to include, as returned by :table-of-contents nil) ("website" :components ("posts" "rss" "tags" "landing" "assets")))) + +(org-publish-initialize-cache "website") -- 2.39.5