change htmlize
[blog.git] / my-publish.el
index 984bb11..7f0cd31 100644 (file)
@@ -28,6 +28,7 @@
 
 (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)
@@ -45,9 +46,9 @@
        "<h1><a href= '/' >Peng Li</a></h1>"
        "<hr>"
        "<nav><ul>"
-       "<li><a href= '/' >About</a></li>"
-       "<li><a href= '/blog.html' >Blog</a></li>"
-       "<li><a href= '/home.html' >Home</a></li>"
+       "<li><a href= '/about.html' >About</a></li>"
+       "<li><a href= '/posts/sitemap.html' >Blog</a></li>"
+       "<li><a href= '/index.html' >Home</a></li>"
        "</ul></nav>"
        "</header>"))
 
@@ -59,11 +60,14 @@ License: <a href= \"https://creativecommons.org/licenses/by-sa/4.0/\">CC BY-SA 4
 (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
@@ -85,7 +89,6 @@ License: <a href= \"https://creativecommons.org/licenses/by-sa/4.0/\">CC BY-SA 4
           :html-postamble ,blog-footer)
 
          ("blog-posts"
-          ;; publishing
           :base-directory ,(concat root-dir "/posts")
           :base-extension "org"
           :publishing-directory ,(concat output-dir "/posts")
@@ -125,13 +128,5 @@ License: <a href= \"https://creativecommons.org/licenses/by-sa/4.0/\">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