X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=my-publish.el;h=825bd892c8c89afd9264eaa80f502202c667b22e;hb=bacacc9c2de6de55468c7b9333c8dd8807428778;hp=244809caa7a116d3da6901c5b406408b37137c93;hpb=c3093661dccae317ca7ab2df83375ad93836c467;p=blog.git diff --git a/my-publish.el b/my-publish.el index 244809c..825bd89 100644 --- a/my-publish.el +++ b/my-publish.el @@ -28,42 +28,44 @@ (require 'org) (require 'ox-publish) +(require 'htmlize) ;; To prevent inline-css when exporting html. will use external css (setq org-html-htmlize-output-type 'css) (setq blog-extra-head (concat - ;; "\n" - "\n" - "" - )) + "\n" + "")) (setq blog-header (concat - " " + "
")) (setq blog-footer - "
\n -

RSS -License: CC BY-SA 4.0\n" + "Org-mode " (org-version) "")) -(defun blog-setup-project-alist (root-dir &optinal output-dir) +(defun blog-setup-project-alist (root-dir &optional output-dir) "Set project alist. `output-dir' is the directory of publish-directory. `root-dir' is the root directory of blog repository." - (unless output-dir (setq output-dir (concat root-dir "_site/"))) + (unless (> (length output-dir) 0) + (setq output-dir (concat root-dir "/_site/"))) + (message "Blog dir is: %s\nOut dir is: %s" + (format root-dir) + (format output-dir)) (setq org-publish-project-alist `( ("blog-pages" - ;; publishing :base-directory ,root-dir :base-extension "org" :publishing-directory ,output-dir @@ -82,10 +84,13 @@ License: CC BY-SA 4 :html-head-include-scripts nil :html-head-extra ,blog-extra-head :html-preamble ,blog-header - :html-postamble ,blog-footer) + :html-postamble ,blog-footer + + ;; other generic options + :with-toc nil + ) ("blog-posts" - ;; publishing :base-directory ,(concat root-dir "/posts") :base-extension "org" :publishing-directory ,(concat output-dir "/posts") @@ -109,7 +114,11 @@ License: CC BY-SA 4 ;; sitemap :auto-sitemap t :sitemap-filename "sitemap.org" - :sitemap-title "Sitemap") + :sitemap-title "Sitemap" + + ;; other generic options + :with-toc nil ; table of contents + ) ("blog-css" :base-directory ,(concat root-dir "/css") @@ -125,13 +134,5 @@ License: CC BY-SA 4 :recursive t) ("blog" :components ("blog-pages" "blog-posts" "blog-css" "blog-cgi"))))) - -(defun blog-publish (out-dir force) - "publish the project" - (interactive) - (blog-setup-project out-dir) - (org-publish-project "blog" force)) - - (provide 'my-publish) ;;; publish.el ends here