diff options
Diffstat (limited to 'publish.el')
-rw-r--r-- | publish.el | 49 |
1 files changed, 11 insertions, 38 deletions
@@ -5,10 +5,12 @@ (unless (package-installed-p 'htmlize) (package-refresh-contents) - (package-install 'htmlize)) + (package-install 'htmlize) + (package-install 'ox-rss)) (require 'org) (require 'ox-html) +(require 'ox-rss) (defun my/org-publish-org-sitemap-format (entry style project) (cond ((not (directory-name-p entry)) @@ -18,30 +20,6 @@ entry (org-publish-find-title entry project))))) -(defun my/org-rss-publish-to-rss (plist filename pub-dir) - (if (equal "rss.org" (file-name-nondirectory filename)) - (org-rss-publish-to-rss plist filename pub-dir))) - -(defun my/format-rss-feed (title list) - (concat "#+TITLE: " title "\n\n" - (org-list-to-subtree list '(:icount "" :istart "")))) - -(defun my/format-rss-feed-entry (entry style project) - (cond ((not (directory-name-p entry)) - (let* ((file (org-publish--expand-file-name entry project)) - (title (org-publish-find-title entry project)) - (date (format-time-string "%Y-%m-%d" (org-publish-find-date entry project))) - (link (concat (file-name-sans-extension entry) ".html"))) - (with-temp-buffer - (insert (format "* [[file:%s][%s]]\n" file title)) - (org-set-property "RSS_PERMALINK" link) - (org-set-property "PUBDATE" date) - (insert-file-contents file) - (buffer-string)))) - ((eq style 'tree) - (file-name-nondirectory (directory-file-name entry))) - (t entry))) - (setq org-publish-project-alist '( ("org-notes" @@ -85,20 +63,15 @@ ("org-rss" :base-directory "~/blog/" :base-extension "org" - :recursive t - :exclude "\\(?:\\(?:index\\|rss\\)\\.org\\)" - :publishing-function my/org-rss-publish-to-rss - :publishing-directory "~/public_html" - :rss-extension "xml" + :html-link-home "https://jjanzen.ca" :html-link-use-abs-url t - :html-link-org-files-as-html t - :auto-sitemap t - :sitemap-filename "rss.org" - :sitemap-title "Jacob Janzen's Blog" - :sitemap-style list - :sitemap-sort-files anti-chronologically - :sitemap-function my/format-rss-feed - :sitemap-format-entry my/format-rss-feed-entry) + :rss-extension "xml" + :publishing-directory "~/public_html/rss" + :publishing-function (org-rss-publish-to-rss) + :section-numbers nil + :exclude ".*" + :include ("index.org") + :table-of-contents nil) ("org-config" :base-directory "~/.doom.d/" :base-extension "org" |