From 9de94d38282dfd91aa3592f751c101451ce02810 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 26 Jan 2018 19:27:05 +0100 Subject: [PATCH] configure ox-publish Signed-off-by: Andreas Gerler --- bba.org | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/bba.org b/bba.org index 6900b695..7e931d43 100644 --- a/bba.org +++ b/bba.org @@ -967,6 +967,104 @@ never heard of orgmode. ) #+END_SRC +** ox-publish +[2018-01-24 Wed 20:29] + + #+BEGIN_SRC emacs-lisp :tangle yes + (require 'ox-html) + (require 'ox-publish) + (require 'ox-rss) + (require 'htmlize) + #+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle yes + (setq org-mode-websrc-directory (concat (getenv "HOME") "/git/website")) + (setq org-mode-publishing-directory (concat (getenv "HOME") "/Sites/")) + + (setq org-publish-project-alist + `(("all" + :components ("blog-content" "blog-static" "blog-rss")) + + ("blog-content" + :base-directory ,org-mode-websrc-directory + :base-extension "org" + :publishing-directory ,org-mode-publishing-directory + :recursive t + :publishing-function org-html-publish-to-html + ; :preparation-function org-mode-blog-prepare + :export-with-tags nil + :headline-levels 4 + :auto-preamble t + :auto-postamble nil + :auto-sitemap t + :sitemap-title "Bundesbrandschatzamt" + :section-numbers nil + :table-of-contents nil + :with-toc nil + :with-author nil + :with-creator nil + :with-tags t + :with-smart-quotes t + + :html-doctype "html5" + :html-html5-fancy t + :html-preamble org-mode-blog-preamble + :html-postamble org-mode-blog-postamble + :html-head " + + + \n" + :html-head-extra " + + + + " + :html-head-include-default-style nil + ) + + ("blog-static" + :base-directory ,org-mode-websrc-directory + :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|svg" + :publishing-directory ,org-mode-publishing-directory + :recursive t + :publishing-function org-publish-attachment + ) + + ("blog-rss" + :base-directory ,org-mode-websrc-directory + :base-extension "org" + :rss-image-url "http://www.bundesbrandschatzamt.de/~baron/img/dragon-head.png" + :publishing-directory ,org-mode-publishing-directory + :publishing-function (org-rss-publish-to-rss) + :html-link-home "http://www.bundesbrandschatzamt.de/~baron/" + :html-link-use-abs-url t + :with-toc nil + :exclude ".*" + :include ("index.org")))) + + (defun org-mode-blog-preamble (options) + "The function that creates the preamble top section for the blog. + OPTIONS contains the property list from the org-mode export." + (let ((base-directory (plist-get options :base-directory))) + (org-babel-with-temp-filebuffer (expand-file-name "top-bar.html" base-directory) (buffer-string)))) + + (defun org-mode-blog-postamble (options) + "The function that creates the postamble, or bottom section for the blog. + OPTIONS contains the property list from the org-mode export." + (let ((base-directory (plist-get options :base-directory))) + (org-babel-with-temp-filebuffer (expand-file-name "bottom.html" base-directory) (buffer-string)))) + + (defun org-mode-blog-prepare () + "`index.org' should always be exported so touch the file before publishing." + (let* ((base-directory (plist-get project-plist :base-directory)) + (buffer (find-file-noselect (expand-file-name "index.org" base-directory) t))) + (with-current-buffer buffer + (set-buffer-modified-p t) + (save-buffer 0)) + (kill-buffer buffer))) +#+END_SRC + + ** bba-ox-clip-formatted-copy [2016-12-13 Tue 15:29] -- 2.47.3