(require 'ox-publish)
+;(require 'ox-rss)
(load "~/.emacs.d/lisp/mustache-html.el")
(setq org-html-doctype "html5")
(setq my-blog-tags-folder (file-name-concat my-blog-source-folder "tags"))
(setq my-blog-posts-folder (file-name-concat my-blog-source-folder "posts"))
+(setq org-export-time-stamp-file nil)
+(setq org-rss-use-entry-url-as-guid nil)
(defun my-org-get-all-filetags ()
"Get list of filetags from all org-files in my-blog-posts-folder."
(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
(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))
(goto-char (point-min))
(insert "#+OPTIONS: ^:nil\n")))) ; do not use underscores as subscript
+(defun my-blog-publish-rss-sitemap (title list)
+ "Create a simple site map, as a string.
+TITLE is the title of the site map. LIST is an internal
+representation for the files to include, as returned by
+`org-list-to-lisp'."
+ (with-temp-buffer
+ (message "Creating RSS index.")
+ (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")
+ (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"))
+ (org-set-property "RSS_PERMALINK" rss-permalink)
+ (org-set-property "PUBDATE" date)
+ (org-set-property "RSS_TITLE" title)
+ (insert preview))))
+ (goto-char (point-min))
+ (insert "#+OPTIONS: ^:nil\n")
+ (write-file "~/websites/stage.vanrenterghem.biz/source/posts/rss.org"))))
+
+
(defun my-blog-cleanup-sitemaps (plist)
"Clean up temporary files created in the process of publishing"
(delete-file (file-name-concat my-blog-source-folder "sitemap.org"))
:publishing-function org-mustache-html-publish-to-html
:mustache-template ,(file-name-concat my-blog-mustache-folder "post.mustache")
:preparation-function my-blog-create-tags-files
- :exclude "html*\\|assets*\\|index.org" ;"assets*\\|sitemap.org\\|index.org" ;; regexp
+ :exclude "html*\\|assets*\\|index.org\\|rss.org" ;"assets*\\|sitemap.org\\|index.org" ;; regexp
:html-content-class nil
:section-numbers nil
:with-toc nil
:html-postamble nil
:sitemap-sort-folders ignore-errors
:sitemap-function my-blog-sitemap
- ;:sitemap-function org-publish-sitemap-default
- ;:sitemap-format-entry my-org-publish-sitemap-default-entry
:sitemap-sort-files anti-chronologically
:sitemap-filename "sitemap.org"
)
:publishing-function org-publish-attachment
:completion-function my-blog-cleanup-sitemaps
)
+
+ ("rss"
+ :base-directory ,my-blog-posts-folder
+ :base-extension "org"
+ :publishing-directory ,my-blog-target-folder
+ :publishing-function org-rss-publish-to-rss
+ :with-author t
- ("website" :components ("posts" "tags" "landing" "assets"))))
+ :html-link-home "https://www.vanrenterghem.biz/"
+ :html-link-use-abs-url t
+
+ :title "Frederik Vanrenterghem"
+ :rss-image-url "https://test/img/feed-icon-28x28.png"
+ ;:my-rss-stylesheet "/res/rss.xsl" ; custom style sheet
+ ;:completion-function my-website-rss-postprocessor
+ :section-numbers nil
+ :exclude ".*"
+ :include ("rss.org")
+ :table-of-contents nil)
+
+ ("website" :components ("posts" "rss" "tags" "landing" "assets"))))