Add publish make target
[blog.git] / posts / Blog-with-org-mode.org
1 #+TITLE: Blog with Org Mode
2 #+AUTHOR: Peng Li
3 #+EMAIL: seudut@gmail.com
4 #+DATE: 2016-10-26
5 #+STARTUP: showall
6 #+STARTUP: inlineimages
7 #+OPTIONS: toc:nil date:t
8
9
10
11
12 今天总算把 Blog 的框架大致弄好了。主要参考了 =Org-mode= 的 tutorial, [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html#Special-comment-section][Publishing Org-mode files to HTML]] 和 [[https://ogbe.net/blog/blogging_with_org.html][Blogging using org-mode (and
13 nothing else)]]。 其中 =css= , 利用的是 =worg.css=, 并参考了[[http://dayigu.github.io/WhyUseOrgModeToWriteBlog.html][为什么用org-mode写 blog?]] 和  [[http://wiki.houye.xyz/blogwithorg-mode.html][用org-mode写博客]]。
14
15 * Org-publish 配置
16 其中有些配置可能是 =Org= 版本不同的原因,有些不同。比如 =htlm-head=, 代替 了 =style=
17 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
18   (require 'ox-publish)
19
20   (setq org-publish-project-alist
21         `(
22           ("org-notes"
23            :base-directory "~/Private/blog/"
24            :base-extension "org"
25            :publishing-directory "~/Private/publish_html"
26            :recursive t
27            :publishing-function org-html-publish-to-html
28            :headline-levels 4
29            :section-numbers nil
30            :auto-preamble t
31            :auto-sitemap t          ;Generate sitmap.org automagicaly...
32            :sitemap-filename "sitemap.org" ;... call it sitemap.org (it's the default )...
33            :sitemap-title "Sitemap"
34
35            :table-of-contents nil
36            :html-postamble nil            ;dont export creator auto validation info in html postamble div
37            :html-link-home "/"
38            :html-head "<link rel='stylesheet' href='./css/org.css' />"
39            ;; :html-head-extra ,my-blog-extra-head
40            :html-head-include-default-style nil
41            :html-head-include-scripts nil)
42           ("org-static"
43            :base-directory "~/Private/blog/"
44            :base-extension "css\\|js\\|png\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
45            :publishing-directory "~/Private/publish_html"
46            :recursive t
47            :publishing-function org-publish-attachment)
48           ("org" :components ("org-notes" "org-static"))))
49 #+END_SRC
50
51 #+BEGIN_SRC sh
52   sudo aptitude install tmux emacs
53 #+END_SRC
54
55 * CI build
56
57 * Web server
58
59 * CGI update