From a2f8f6e35d76f191b42aad6f0344506e441a235a Mon Sep 17 00:00:00 2001 From: Jacob Janzen Date: Mon, 15 Apr 2024 19:41:34 -0500 Subject: insert file contents --- publish.el | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) (limited to 'publish.el') diff --git a/publish.el b/publish.el index b2ed82e..ccd5b08 100644 --- a/publish.el +++ b/publish.el @@ -35,36 +35,22 @@ (defun format-posts-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: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))) + (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%s" + title + link + pubdate + (insert-file-contents file)))) (defun publish-posts-rss-feed (plist filename dir) (if (equal "rss.org" (file-name-nondirectory filename)) -- cgit v1.2.3