(require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) (setq package-load-list '((htmlize t))) (package-initialize) (unless (package-installed-p 'htmlize) (package-refresh-contents) (package-install 'htmlize)) (require 'org) (require 'ox-html) (defun my/org-publish-org-sitemap-format (entry style project) (cond ((not (directory-name-p entry)) (format "(%s) [[file:%s][%s]]\n" (format-time-string "%Y-%m-%d" (org-publish-find-date entry project)) 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" :base-directory "~/website/" :base-extension "org" :publishing-directory "~/public_html/" :recursive t :publishing-function org-html-publish-to-html :with-toc nil :headline-levels 4 :section-numbers nil :html-head "" :html-preamble "
HomeProjectsBlogDotfilesAbout Me
" :html-postamble nil) ("org-static" :base-directory "~/website/" :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf" :publishing-directory "~/public_html" :recursive t :publishing-function org-publish-attachment) ("org-blog" :base-directory "~/blog/" :base-extension "org" :publishing-directory "~/public_html/blog" :recursive t :publishing-function org-html-publish-to-html :with-toc nil :with-properties t :with-date t :with-timestamps nil :headline-levels 4 :section-numbers nil :html-head "" :html-preamble "
HomeProjectsBlogDotfilesAbout Me
" :html-postamble nil :auto-sitemap t :sitemap-filename "index.org" :sitemap-format-entry my/org-publish-org-sitemap-format :sitemap-sort-files anti-chronologically :sitemap-title "Blog") ("org-rss" :base-directory "~/blog/" :base-extension "org" :recursive t :exclude (regexp-opt '("rss.org" "index.org")) :publishing-function my/org-rss-publish-to-rss :publishing-directory "~/public_html" :rss-extension "xml" :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) ("org-config" :base-directory "~/.doom.d/" :base-extension "org" :html-head "" :html-preamble "
HomeProjectsBlogDotfilesAbout Me
" :html-postamble nil :publishing-directory "~/public_html" :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t) ("org" :components ("org-notes" "org-static" "org-config")))) (org-publish-all t)