afc0759fca38460350caab3c6e7f4057bde21082
[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
13 今天总算把 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
14 nothing else)]]。 其中 =css= , 利用的是 =worg.css=, 并参考了[[http://dayigu.github.io/WhyUseOrgModeToWriteBlog.html][为什么用org-mode写 blog?]] 和  [[http://wiki.houye.xyz/blogwithorg-mode.html][用org-mode写博客]]。
15
16 * Org-publish 配置
17 其中有些配置可能是 =Org= 版本不同的原因,有些不同。比如 =htlm-head=, 代替 了 =style=
18 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
19   (require 'ox-publish)
20
21   (setq org-publish-project-alist
22         `(
23           ("org-notes"
24            :base-directory "~/Private/blog/"
25            :base-extension "org"
26            :publishing-directory "~/Private/publish_html"
27            :recursive t
28            :publishing-function org-html-publish-to-html
29            :headline-levels 4
30            :section-numbers nil
31            :auto-preamble t
32            :auto-sitemap t          ;Generate sitmap.org automagicaly...
33            :sitemap-filename "sitemap.org" ;... call it sitemap.org (it's the default )...
34            :sitemap-title "Sitemap"
35
36            :table-of-contents nil
37            :html-postamble nil            ;dont export creator auto validation info in html postamble div
38            :html-link-home "/"
39            :html-head "<link rel='stylesheet' href='./css/org.css' />"
40            ;; :html-head-extra ,my-blog-extra-head
41            :html-head-include-default-style nil
42            :html-head-include-scripts nil)
43           ("org-static"
44            :base-directory "~/Private/blog/"
45            :base-extension "css\\|js\\|png\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
46            :publishing-directory "~/Private/publish_html"
47            :recursive t
48            :publishing-function org-publish-attachment)
49           ("org" :components ("org-notes" "org-static"))))
50 #+END_SRC