Change make file and blog.el
authorPeng Li <seudut@gmail.com>
Sat, 4 Mar 2017 16:01:52 +0000 (00:01 +0800)
committerPeng Li <seudut@gmail.com>
Sat, 4 Mar 2017 16:01:52 +0000 (00:01 +0800)
Makefile
blog.el
sitemap.org

index 8d478c8..ce75237 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,12 +2,10 @@
 
 emacs ?= emacs
 
-OUT_DIR=/Users/peli3/Private/blog/_site
+OUTDIR := ""
 
 all:
-       $(emacs) -Q --batch \
-               -l ./blog.el \
-               index.org \
-               --eval '(org-publish-current-project t)'
+       $(emacs) -Q --script blog.el $(OUTDIR)
+
 clean:
        rm -rf _site/*
diff --git a/blog.el b/blog.el
index 7d21236..3fd2209 100644 (file)
--- a/blog.el
+++ b/blog.el
 ;; constants
 ;; (defconst root-dir "~/Private/blog/")
 (defconst root-dir (file-name-directory (or load-file-name buffer-file-name)))
-(defconst publish-dir (concat root-dir "_site/"))
+(defvar publish-dir (concat root-dir "_site/"))
 (defconst css-file "../css/worg.css")
 ;; (defconst css-file (concat root-dir "css/worg.css"))
 
+(let ((aa (pop command-line-args-left)))
+  (if (>  (length aa) 0)
+      (setq publish-dir aa)))
 
+;; (setq publish-dir (or (pop command-line-args-left) publish-dir))
+(message publish-dir)
 
 (require 'org)
-;; (require 'org-html)
 (require 'ox-publish)
 (require 'htmlize)
 
-
+(message "Org-mode version %s" (org-version))
+(message "publish directory is %s" publish-dir)
 
 ;; To prevent inline-css when exporting html. will use external css
 (setq org-html-htmlize-output-type 'css)
@@ -86,5 +91,8 @@
         ("org" :components ("org-notes" "org-static"))))
 
 
-(provide 'blog)
+(org-publish-project "org" t)
+
+;; (provide 'blog)
+(kill-emacs 0)
 ;;; blog.el ends here
index 698e8bb..3d5aac8 100644 (file)
@@ -2,6 +2,7 @@
 
    + posts
      + [[file:posts/Blog-with-org-mode.org][Blog with Org Mode]]
+     + [[file:posts/emacs-note.org][Emacs Lisp Study Note]]
      + [[file:posts/git-note.org][Git Note]]
      + [[file:posts/My-work-flow-with-tmux-vim-zsh-iterm.org][My Work Flow with Tmux + Vim + Zsh + iTerm2]]
      + [[file:posts/linux-note.org][Note of Linux (Debian)]]