From 70abefc0a63967ff5b2d57050538b16d701696c6 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sat, 2 Dec 2023 23:26:58 -0600 Subject: feat: add initial RSS support and centralize project settings --- elisp/publish.el | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 elisp/publish.el (limited to 'elisp/publish.el') diff --git a/elisp/publish.el b/elisp/publish.el new file mode 100644 index 0000000..c8dbdf1 --- /dev/null +++ b/elisp/publish.el @@ -0,0 +1,58 @@ +;; Publish org files to HTML + +;; Functions +(defun org-rss-publish-to-rss (plist filename pub-dir) + "Publish RSS with PLIST, only when FILENAME is 'rss.org'. +PUB-DIR is when the output will be placed." + (if (equal "rss.org" (file-name-nondirectory filename)) + (org-rss-export-to-rss plist filename pub-dir))) + +;; Project publishing settings +(setq org-publish-project-alist + '(("cleberg.net" + :base-directory "~/Source/cleberg.net/" + :publishing-function org-html-publish-to-html + :publishing-directory "~/Source/cleberg.net/public/" + :auto-sitemap t + :recursive t + :section-numbers nil + :with-author nil + :html-validation-link nil + :with-tags t + :html-head-include-default-style nil + :html-head-include-scripts nil + :html-head "" + :html-preamble "") + + ("rss" + :base-directory "~/Source/cleberg.net/blog/" + :base-extension "org" + :html-link-home "https://cleberg.net/" + :html-link-use-abs-url t + :rss-extension "xml" + :publishing-directory "~/Source/cleberg.net/public/blog/" + :publishing-function org-rss-publish-to-rss + :section-numbers nil + :exclude "index.org" + :author "cmc" + :email "" + ;; test + :html-link-org-files-as-html t + :auto-sitemap t + :sitemap-filename "rss.org" + :sitemap-title "cleberg.net" + :sitemap-style list + :sitemap-sort-files anti-chronologically + ;;:sitemap-function 'rw/format-rss-feed + ;;:sitemap-format-entry 'rw/format-rss-feed-entry + ;; end test + ) + + ("static" + :base-directory "~/Source/cleberg.net/static/" + :base-extension "css\\|el" + :publishing-directory "~/Source/cleberg.net/public/static/" + :publishing-function org-publish-attachment) + ("website" :components ("cleberg.net" "rss" "static")))) + +(provide 'publish) -- cgit v1.2.3-70-g09d2