merge and update
[blog.git] / blog.el
1 ;;; blog.el --- Config file used to export blog      -*- lexical-binding: t; -*-
2
3 ;; Copyright (C) 2017  Peng Li
4
5 ;; Author: Peng Li <seudut@gmail.com>
6 ;; Keywords: lisp
7
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
12
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21 ;;; Commentary:
22
23 ;; This is emacs config used to export Blog Org files in batch mode.
24
25 ;;; Code:
26
27 (require 'package)
28 (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
29 (package-initialize)
30 (setq debug-on-error t)
31
32 (unless (package-installed-p 'htmlize)
33   (package-refresh-contents)
34   (package-install 'htmlize))
35
36 (require 'org)
37 (require 'ox-publish)
38 (require 'htmlize)
39
40 ;; To prevent inline-css when exporting html. will use external css
41 (setq org-html-htmlize-output-type 'css)
42
43 (setq org-publish-project-alist
44       `(
45         ("org-notes"
46          :base-directory "~/Private/blog/"
47          :base-extension "org"
48          :publishing-directory "~/Private/publish_html"
49          :recursive t
50          :publishing-function org-html-publish-to-html
51          :headline-levels 4
52          :section-numbers nil
53          :auto-preamble t
54          :auto-sitemap t          ;Generate sitmap.org automagicaly...
55          :sitemap-filename "sitemap.org" ;... call it sitemap.org (it's the default )...
56          :sitemap-title "Sitemap"
57
58          :html-table-of-contents nil
59          :html-postamble nil ;dont export creator auto validation info in html postamble div
60          :html-link-home "/"
61          :html-head "<link rel='stylesheet' href='/Users/peli3/Private/blog/res/worg.css' />"
62          :html-head-include-default-style nil
63          :html-head-include-scripts nil)
64         ("org-static"
65          :base-directory "~/Private/blog/"
66          :base-extension "css\\|js\\|png\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
67          :publishing-directory "~/Private/publish_html"
68          :recursive t
69          :publishing-function org-publish-attachment
70          :table-of-contents nil)
71         ("org" :components ("org-notes" "org-static"))))
72
73
74 (provide 'blog)
75 ;;; blog.el ends here