diff options
author | Jacob Janzen <jjanzenn@proton.me> | 2024-04-15 19:37:33 -0500 |
---|---|---|
committer | Jacob Janzen <jjanzenn@proton.me> | 2024-04-15 19:37:33 -0500 |
commit | 9d2401402d0f4d975f95e8629a25f8ffe4b057b6 (patch) | |
tree | bf9cf9feb345ace911dea50b3b119f53112171d2 | |
parent | 558f939342466f220c963bfcaf00e7b29d18a952 (diff) |
different rss-entry-func
-rw-r--r-- | publish.el | 45 |
1 files changed, 30 insertions, 15 deletions
@@ -35,21 +35,36 @@ (defun format-posts-rss-feed-entry (entry _style project) - (let* ( - (title (org-publish-find-title entry project)) - (link (concat (file-name-sans-extension entry) ".html")) - (pubdate (format-time-string (car org-time-stamp-formats) - (org-publish-find-date entry project)))) - (message pubdate) - (format "%s -:properties: -:rss_permalink: blog/%s -:pubdate: %s -:author: Jacob Janzen -:end:\n" - title - link - pubdate))) + (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:blog/%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) + ;; Return only last subdir. + (file-name-nondirectory (directory-file-name entry))) + (t entry))) +;; (let* ( +;; (title (org-publish-find-title entry project)) +;; (link (concat (file-name-sans-extension entry) ".html")) +;; (pubdate (format-time-string (car org-time-stamp-formats) +;; (org-publish-find-date entry project)))) +;; (message pubdate) +;; (format "%s +;;:properties: +;;:rss_permalink: blog/%s +;;:pubdate: %s +;;:author: Jacob Janzen +;;:end:\n" +;; title +;; link +;; pubdate))) (defun publish-posts-rss-feed (plist filename dir) (if (equal "rss.org" (file-name-nondirectory filename)) |