From c6ccbad44780ea0fd5403a728068b398510c11e0 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Sun, 5 Mar 2017 00:01:52 +0800 Subject: [PATCH] Change make file and blog.el --- Makefile | 8 +++----- blog.el | 16 ++++++++++++---- sitemap.org | 1 + 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8d478c8..ce75237 100644 --- 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 --- a/blog.el +++ b/blog.el @@ -39,18 +39,23 @@ ;; 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 diff --git a/sitemap.org b/sitemap.org index 698e8bb..3d5aac8 100644 --- a/sitemap.org +++ b/sitemap.org @@ -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)]] -- 2.11.0