博客

导出博客信息
属性
file
"/home/exaos/Workspace/exaos/utils/o-blog/example/sample-zh.org"
buffer
#<buffer sample-zh.org>
publish-dir
"out"
template-dir
"../templates"
style-dir
"style"
posts-filter
"+TODO=\"DONE\""
static-filter
"+PAGE={.+.html}"
snippet-filter
"+SNIPPET={.+}"
title
"o-blog"
description
"使用 org-mode 的独立博客系统"
post-build-shell
("cmd 4" "cmd 3" "cmd 2" "cmd 1")

博文

在博文中添加图片

导出博文信息 在博文中添加图片
属性
id
0
title
"在博文中添加图片"
timespamp
(20530 62900)
year
2012
month
8
day
21
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "o-blog" "o-blog" nil nil])
template
"blog_post.html"
filepath
"tips/2012/08"
filename
"00733d4efa6667a085bebed8a14b1026"
htmlfile
"tips/2012/08/21_00733d4efa6667a085bebed8a14b1026.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


#+BEGIN_HTML
<div class=\"row \"><div class=\"span8 \">
#+END_HTML


向博文中添加图片非常简单,因为 [[http://org-mode.org][Org-mode]] 提供了一个特别的链接机制。只要它的路径是
合法的,图片源文件可以存储在任意位置。在导出页面时,图片文件会被拷贝到与博文相对
的文件夹下,所有的链接都会修订到新的位置上。


#+BEGIN_HTML
<div class=\"row \"><div class=\"span5 \">
#+END_HTML


比如,下面这段代码会将文件 =emacs-logo.png= 从当前路径拷贝到
=tips/2012/08/21_adding-an-image-into-a-post/emacs-logo.png=.

#+BEGIN_HTML
</div><div class=\"span3 \">
#+END_HTML



#+BEGIN_SRC org
 file:emacs-logo.png
#+END_SRC


#+BEGIN_HTML
</div></div>
#+END_HTML




#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML

[[file:../../../tips/2012/08/21_00733d4efa6667a085bebed8a14b1026/emacs-logo.png]]


#+BEGIN_HTML
</div></div>
#+END_HTML




HTML 输出结果与下面类似:

#+BEGIN_SRC html
 <img src=\"21_adding-an-image-into-a-post/emacs-logo.png\"  alt=\"21_adding-an-image-into-a-post/emacs-logo.png\" />
#+END_SRC


最方便的办法是将所有文件都放在一个 =/files/= 文件夹下。然后你可以在其中为每篇博文
创建一个子目录:
 - =/files/post1/file1=
 - =/files/post1/file2=
 - =/files/post2/file=
 - ...
"
content-html
"<div class=\"row \"><div class=\"span8 \">


<p>
向博文中添加图片非常简单,因为 <a href=\"http://org-mode.org\">Org-mode</a> 提供了一个特别的链接机制。只要它的路径是
合法的,图片源文件可以存储在任意位置。在导出页面时,图片文件会被拷贝到与博文相对
的文件夹下,所有的链接都会修订到新的位置上。
</p>



<div class=\"row \"><div class=\"span5 \">


<p>
比如,下面这段代码会将文件 <code>emacs-logo.png</code> 从当前路径拷贝到
<code>tips/2012/08/21_adding-an-image-into-a-post/emacs-logo.png</code>.
</p>


</div><div class=\"span3 \">




<pre class=\"src src-org\"><span style=\"color: #0000ff;\">file:emacs-logo.png</span>
</pre>



</div></div>




</div><div class=\"span4 \">

<p>
<img src=\"../../../tips/2012/08/21_00733d4efa6667a085bebed8a14b1026/emacs-logo.png\"  alt=\"../../../tips/2012/08/21_00733d4efa6667a085bebed8a14b1026/emacs-logo.png\" />
</p>



</div></div>




<p>
HTML 输出结果与下面类似:
</p>



<pre class=\"src src-html\">&lt;<span style=\"color: #87cefa;\">img</span> <span style=\"color: #eedd82;\">src</span>=<span style=\"color: #ffa07a;\">\"21_adding-an-image-into-a-post/emacs-logo.png\"</span>  <span style=\"color: #eedd82;\">alt</span>=<span style=\"color: #ffa07a;\">\"21_adding-an-image-into-a-post/emacs-logo.png\"</span> /&gt;
</pre>



<p>
最方便的办法是将所有文件都放在一个 <code>/files/</code> 文件夹下。然后你可以在其中为每篇博文
创建一个子目录:
</p><ul>
<li><code>/files/post1/file1</code>
</li>
<li><code>/files/post1/file2</code>
</li>
<li><code>/files/post2/file</code>
</li>
<li>&hellip;
</li>
</ul>

"

创建静态页面

导出博文信息 创建静态页面
属性
id
1
title
"创建静态页面"
timespamp
(20409 51456)
year
2012
month
5
day
21
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "Bootstrap" "bootstrap" nil nil] [cl-struct-ob:tags "o-blog" "o-blog" nil nil])
template
"blog_post.html"
filepath
"tips/2012/05"
filename
"static-pages"
htmlfile
"tips/2012/05/21_static-pages.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


#+BEGIN_HTML
<div class=\"row \"><div class=\"span7 \">
#+END_HTML



创建静态页面与创建博文页面一样。你唯一需要做的就是添加属性 =PAGE=. 导出的路径相对
于 =#+PUBLISH_DIR:=.

你也可以为静态页面指定自定义模版,只需添加属性 =TEMPLATE=. 模版路径相对于
=#+TEMPLATE_DIR:=.

#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML


#+BEGIN_SRC org
  ,* Static page
  ,   :PROPERTIES:
  ,   :PAGE:     path/to/static/page.html
  ,   :TEMPLATE: static-page.html
  ,   :END:
#+END_SRC


#+BEGIN_HTML
</div></div>
#+END_HTML
"
content-html
"<div class=\"row \"><div class=\"span7 \">



<p>
创建静态页面与创建博文页面一样。你唯一需要做的就是添加属性 <code>PAGE</code>. 导出的路径相对
于 <code>#+PUBLISH_DIR:</code>.
</p>
<p>
你也可以为静态页面指定自定义模版,只需添加属性 <code>TEMPLATE</code>. 模版路径相对于
<code>#+TEMPLATE_DIR:</code>.
</p>


</div><div class=\"span4 \">



<pre class=\"src src-org\"><span style=\"color: #87cefa;\">* Static page</span>
<span style=\"color: #00ffff;\">   :PROPERTIES:</span>
   <span style=\"color: #00ffff;\">:PAGE:</span>     path/to/static/page.html
   <span style=\"color: #00ffff;\">:TEMPLATE:</span> static-page.html
<span style=\"color: #00ffff;\">   :END:</span>
</pre>



</div></div>
"

添加自定义字体

导出博文信息 添加自定义字体
属性
id
2
title
"添加自定义字体"
timespamp
(20391 35304)
year
2012
month
5
day
7
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "Bootstrap" "bootstrap" nil nil] [cl-struct-ob:tags "o-blog" "o-blog" nil nil])
template
"blog_post.html"
filepath
"tips/2012/05"
filename
"custom-fonts"
htmlfile
"tips/2012/05/07_custom-fonts.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


可在 o-blog 中用两种方式使用 [[http://www.google.com/webfonts][Google webfonts]]:使用 google API 或者在
=templates/style= 目录中提供资源。

#+BEGIN_HTML
<div class=\"alert alert-warning\"><p class=\"alert-heading\">Caution</p>
#+END_HTML

使用许多字体样式会让你的页面变得很慢,因此仅选择那些你页面中实际需要的字体样式。

#+BEGIN_HTML
</div>
#+END_HTML


Both example are given using the [[http://www.yanone.de/typedesign/kaffeesatz/][Yanone Kaffeesatz]] font.

** Using Google API

The [[http://www.google.com/webfonts#QuickUsePlace:quickUse/Family:][quick use]] provides an import snippet such as:

#+BEGIN_SRC css
@import url(\"http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,200,300,700&subset=latin,latin-ext\");
#+END_SRC

That line should be included into the
=templates/style/less/o-blog-default.less= file in which you should also add
something like:

#+BEGIN_SRC css
h1, h2, h3, h4, h5, h6 {
    font-family: \"Yanone Kaffeesatz\", sans-serif;
}
#+END_SRC

And that's it.

** Providing resources

That is less efficient in terms of network resources but provide a good
alternative for offline publications.


The script =get-font= does all needed jobs.

#+BEGIN_HTML
<div class=\"o-blog-source\"><a class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#get-font\" ><i class=\"icon-file icon-white\"></i>&nbsp;get-font</a></div><div class=\"modal fade hide\" id=\"get-font\"><div class=\"modal-header\"><a class=\"close\" data-dismiss=\"modal\">×</a><h3>get-font</h3></div><div class=\"modal-body\"><pre>
<span style=\"color: #ff4500;\">#</span><span style=\"color: #ff4500;\">!/bin/</span><span style=\"color: #00ffff;\">sh</span><span style=\"color: #ff4500;\">
</span>
<span style=\"color: #00ffff;\">if </span><span style=\"color: #b0c4de;\">test</span> -z <span style=\"color: #ffa07a;\">\"$1\"</span>; <span style=\"color: #00ffff;\">then</span>
    <span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"Usage: $0 font-url\"</span>
    <span style=\"color: #00ffff;\">exit</span> 1
<span style=\"color: #00ffff;\">fi</span>

<span style=\"color: #eedd82;\">FONT_DIR</span>=templates/style/font
<span style=\"color: #eedd82;\">LESS_DIR</span>=templates/style/less

<span style=\"color: #eedd82;\">FONT_URL</span>=<span style=\"color: #ffa07a;\">\"$1\"</span>
<span style=\"color: #eedd82;\">LESS_FILE</span>=$(<span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"$FONT_URL\"</span> | sed -n <span style=\"color: #ffa07a;\">'s/.*family=\\([^:]\\+\\).*/\\1/p'</span> | sed <span style=\"color: #ffa07a;\">'s/+/-/g'</span>)

<span style=\"color: #ff4500;\"># </span><span style=\"color: #ff4500;\">Wee need to provide a valid user agent to get woff fonts
</span><span style=\"color: #eedd82;\">UA</span>=<span style=\"color: #ffa07a;\">'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11'</span>


<span style=\"color: #eedd82;\">CSS</span>=$(curl -H <span style=\"color: #ffa07a;\">\"${UA}\"</span> ${<span style=\"color: #eedd82;\">FONT_URL</span>})

<span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"${CSS}\"</span> | sed -n <span style=\"color: #ffa07a;\">\"s#.*local('\\([^']\\+\\)'), url('\\([^']\\+\\)').*#curl -o ${FONT_DIR}/\\1.woff \\2#p\"</span> | sh -

<span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"${CSS}\"</span> | sed  <span style=\"color: #ffa07a;\">\"s#\\(.*\\)local('\\([^']\\+\\)'), url('\\([^']\\+\\)')\\(.*\\)#\\1local('\\2'), url('../font/\\2.woff')\\4#\"</span>  &gt; <span style=\"color: #ffa07a;\">\"${LESS_DIR}/font-${LESS_FILE}.less\"</span>

<span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"You should add '@import \\\"font-${LESS_FILE}.less\\\";' to templates/style/less/o-blog-default.less\"</span>
</pre></div></div>
#+END_HTML


You can run:

#+BEGIN_SRC sh
./get-font 'http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,200,300,700&subset=latin,latin-ext'
#+END_SRC

And add the font declaration in =templates/style/less/o-blog-default.less=:

#+BEGIN_SRC css
@import \"font-Yanone-Kaffeesatz.less\";
#+END_SRC

Add declare its use like in the Google API version:

#+BEGIN_SRC css
h1, h2, h3, h4, h5, h6 {
    font-family: \"Yanone Kaffeesatz\", sans-serif;
}
#+END_SRC"
content-html
"<p>
可在 o-blog 中用两种方式使用 <a href=\"http://www.google.com/webfonts\">Google webfonts</a>:使用 google API 或者在
<code>templates/style</code> 目录中提供资源。
</p>


<div class=\"alert alert-warning\"><p class=\"alert-heading\">Caution</p>

<p>
使用许多字体样式会让你的页面变得很慢,因此仅选择那些你页面中实际需要的字体样式。
</p>


</div>


<p>
Both example are given using the <a href=\"http://www.yanone.de/typedesign/kaffeesatz/\">Yanone Kaffeesatz</a> font.
</p>

<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">Using Google API</h3>
<div class=\"outline-text-3\" id=\"text-1\">


<p>
The <a href=\"http://www.google.com/webfonts#QuickUsePlace:quickUse/Family:\">quick use</a> provides an import snippet such as:
</p>



<pre class=\"src src-css\"><span style=\"color: #00ffff;\">@import</span> url(<span style=\"color: #ffa07a;\">\"http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,200,300,700&amp;subset=latin,latin-ext\"</span>);
</pre>


<p>
That line should be included into the
<code>templates/style/less/o-blog-default.less</code> file in which you should also add
something like:
</p>



<pre class=\"src src-css\">h1, h2, h3, h4, h5, h6 {
    <span style=\"color: #00ffff;\">font-family:</span> <span style=\"color: #ffa07a;\">\"Yanone Kaffeesatz\"</span>, sans-serif;
}
</pre>


<p>
And that's it.
</p>
</div>

</div>

<div id=\"outline-container-2\" class=\"outline-3\">
<h3 id=\"sec-2\">Providing resources</h3>
<div class=\"outline-text-3\" id=\"text-2\">


<p>
That is less efficient in terms of network resources but provide a good
alternative for offline publications.
</p>

<p>
The script <code>get-font</code> does all needed jobs.
</p>


<div class=\"o-blog-source\"><a class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#get-font\" ><i class=\"icon-file icon-white\"></i>&nbsp;get-font</a></div><div class=\"modal fade hide\" id=\"get-font\"><div class=\"modal-header\"><a class=\"close\" data-dismiss=\"modal\">×</a><h3>get-font</h3></div><div class=\"modal-body\"><pre>
<span style=\"color: #ff4500;\">#</span><span style=\"color: #ff4500;\">!/bin/</span><span style=\"color: #00ffff;\">sh</span><span style=\"color: #ff4500;\">
</span>
<span style=\"color: #00ffff;\">if </span><span style=\"color: #b0c4de;\">test</span> -z <span style=\"color: #ffa07a;\">\"$1\"</span>; <span style=\"color: #00ffff;\">then</span>
    <span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"Usage: $0 font-url\"</span>
    <span style=\"color: #00ffff;\">exit</span> 1
<span style=\"color: #00ffff;\">fi</span>

<span style=\"color: #eedd82;\">FONT_DIR</span>=templates/style/font
<span style=\"color: #eedd82;\">LESS_DIR</span>=templates/style/less

<span style=\"color: #eedd82;\">FONT_URL</span>=<span style=\"color: #ffa07a;\">\"$1\"</span>
<span style=\"color: #eedd82;\">LESS_FILE</span>=$(<span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"$FONT_URL\"</span> | sed -n <span style=\"color: #ffa07a;\">'s/.*family=\\([^:]\\+\\).*/\\1/p'</span> | sed <span style=\"color: #ffa07a;\">'s/+/-/g'</span>)

<span style=\"color: #ff4500;\"># </span><span style=\"color: #ff4500;\">Wee need to provide a valid user agent to get woff fonts
</span><span style=\"color: #eedd82;\">UA</span>=<span style=\"color: #ffa07a;\">'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.65 Safari/535.11'</span>


<span style=\"color: #eedd82;\">CSS</span>=$(curl -H <span style=\"color: #ffa07a;\">\"${UA}\"</span> ${<span style=\"color: #eedd82;\">FONT_URL</span>})

<span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"${CSS}\"</span> | sed -n <span style=\"color: #ffa07a;\">\"s#.*local('\\([^']\\+\\)'), url('\\([^']\\+\\)').*#curl -o ${FONT_DIR}/\\1.woff \\2#p\"</span> | sh -

<span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"${CSS}\"</span> | sed  <span style=\"color: #ffa07a;\">\"s#\\(.*\\)local('\\([^']\\+\\)'), url('\\([^']\\+\\)')\\(.*\\)#\\1local('\\2'), url('../font/\\2.woff')\\4#\"</span>  &gt; <span style=\"color: #ffa07a;\">\"${LESS_DIR}/font-${LESS_FILE}.less\"</span>

<span style=\"color: #b0c4de;\">echo</span> <span style=\"color: #ffa07a;\">\"You should add '@import \\\"font-${LESS_FILE}.less\\\";' to templates/style/less/o-blog-default.less\"</span>
</pre></div></div>


<p>
You can run:
</p>



<pre class=\"src src-sh\">./get-font <span style=\"color: #ffa07a;\">'http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,200,300,700&amp;subset=latin,latin-ext'</span>
</pre>


<p>
And add the font declaration in <code>templates/style/less/o-blog-default.less</code>:
</p>



<pre class=\"src src-css\"><span style=\"color: #00ffff;\">@import</span> <span style=\"color: #ffa07a;\">\"font-Yanone-Kaffeesatz.less\"</span>;
</pre>


<p>
Add declare its use like in the Google API version:
</p>



<pre class=\"src src-css\">h1, h2, h3, h4, h5, h6 {
    <span style=\"color: #00ffff;\">font-family:</span> <span style=\"color: #ffa07a;\">\"Yanone Kaffeesatz\"</span>, sans-serif;
}
</pre>

</div>
</div>
"

一些 bootstrap 特性

导出博文信息 一些 bootstrap 特性
属性
id
3
title
"一些 bootstrap 特性"
timespamp
(20386 35504)
year
2012
month
5
day
3
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "Bootstrap" "bootstrap" nil nil])
template
"blog_post.html"
filepath
"tips/2012/05"
filename
"bootstrap-features"
htmlfile
"tips/2012/05/03_bootstrap-features.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


** Hero-unit

#+BEGIN_HTML
<div class=\"row \"><div class=\"span7 \">
#+END_HTML


#+BEGIN_SRC org
  ,#+begin_o_blog_hero_unit
  ,#+HTML: <h1>Heading</h1>

  , tagline

  ,#+BEGIN_HTML
  ,    <a class=\"btn btn-primary btn-large\">
  ,      Learn more
  ,    </a>
  ,#+END_HTML
  ,#+end_o_blog_hero_unit
#+END_SRC

#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML


#+BEGIN_HTML
<div class=\"hero-unit\">

#+END_HTML


#+HTML: <h1>Heading</h1>

tagline

#+BEGIN_HTML
    <a class=\"btn btn-primary btn-large\">
      Learn more
    </a>
#+END_HTML

#+BEGIN_HTML
</div>

#+END_HTML



#+BEGIN_HTML
</div></div>
#+END_HTML


** 页头设置

#+BEGIN_HTML
<div class=\"row \"><div class=\"span7 \">
#+END_HTML


#+BEGIN_SRC org
  ,#+begin_o_blog_page_header
  ,#+HTML: <h1>Page header</h1>
  ,Some text
  ,#+end_o_blog_page_header
#+END_SRC

#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML


#+BEGIN_HTML
<div class=\"page-header\">

#+END_HTML

#+HTML: <h1>Page header</h1>
Some text

#+BEGIN_HTML
</div>

#+END_HTML



#+BEGIN_HTML
</div></div>
#+END_HTML


** 使用标注 (label)

    标注及注释文本使用 =label:TYPE= 链接方式,其中的 =TYPE= 可取值为 =default=,
    =success=, =warning=, =important=, =info= 或 =reverse=. 链接的 URL 部分用作标
    注文本。

#+BEGIN_HTML
<div class=\"row \"><div class=\"span7 \">
#+END_HTML


#+BEGIN_SRC txt
   [[ob-label:default][Default]]
   [[ob-label:success][Success]]
   [[ob-label:warning][Warning]]
   [[ob-label:important][Important]]
   [[ob-label:info][Info]]
   [[ob-label:inverse][Inverse]]
#+END_SRC

#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML

   - [[ob-label:default][Default]]
   - [[ob-label:success][Success]]
   - [[ob-label:warning][Warning]]
   - [[ob-label:important][Important]]
   - [[ob-label:info][Info]]
   - [[ob-label:inverse][Inverse]]

#+BEGIN_HTML
</div></div>
#+END_HTML


** 使用标记 (badges)

    将提示及未读计数当作标注 (label), 使用链接前缀 =badge:TYPE=.

#+BEGIN_HTML
<div class=\"row \"><div class=\"span7 \">
#+END_HTML


#+BEGIN_SRC  text
   [[ob-badge:default][Default]]
   [[ob-badge:success][Success]]
   [[ob-badge:warning][Warning]]
   [[ob-badge:important][Important]]
   [[ob-badge:info][Info]]
   [[ob-badge:inverse][Inverse]]
#+END_SRC

#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML

   - [[ob-badge:default][Default]]
   - [[ob-badge:success][Success]]
   - [[ob-badge:warning][Warning]]
   - [[ob-badge:important][Important]]
   - [[ob-badge:info][Info]]
   - [[ob-badge:inverse][Inverse]]

#+BEGIN_HTML
</div></div>
#+END_HTML


** 使用进度条

    用于载入、重定向或动作状态。使用链接前缀 =progress:TYPE=, 此处的 =TYPE= 可取
    值 =info=, =success=, =warning= 或 =danger=. 额外的类 (=striped= 或
    =active=) 可用逗号添加。 URL 为进度百分比。

#+BEGIN_HTML
<div class=\"row \"><div class=\"span7 \">
#+END_HTML


#+BEGIN_SRC  text
    [[ob-progress:info][25]]
    [[ob-progress:success,striped][50]]
    [[ob-progress:warning,striped,active][75]]
    [[ob-progress:danger][100]]
#+END_SRC

#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML

    [[ob-progress:info][25]]
    [[ob-progress:success,striped][50]]
    [[ob-progress:warning,striped,active][75]]
    [[ob-progress:danger][100]]

#+BEGIN_HTML
</div></div>
#+END_HTML



** Well

Use the well as a simple effect on an element to give it an inset effect.

#+BEGIN_HTML
<div class=\"row \"><div class=\"span7 \">
#+END_HTML


#+BEGIN_SRC  text
 , #+begin_o_blog_well
 , Look, I'm in a well!
 , #+end_o_blog_well
#+END_SRC

#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML



#+BEGIN_HTML
<div class=\"well\">

#+END_HTML

Look, I'm in a well!

#+BEGIN_HTML
</div>

#+END_HTML



#+BEGIN_HTML
</div></div>
#+END_HTML

"
content-html
"<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">Hero-unit</h3>
<div class=\"outline-text-3\" id=\"text-1\">




<div class=\"row \"><div class=\"span7 \">



<pre class=\"src src-org\"><span style=\"color: #ff4500;\">#+begin_o_blog_hero_unit</span>
<span style=\"color: #ff4500;\">#+HTML: &lt;h1&gt;Heading&lt;/h1&gt;

 tagline

#+BEGIN_HTML
    &lt;a class=\"btn btn-primary btn-large\"&gt;
      Learn more
    &lt;/a&gt;
</span><span style=\"color: #ff4500;\">#+end_o_blog_hero_unit</span>
</pre>


</div><div class=\"span4 \">


<div class=\"hero-unit\">





<h1>Heading</h1>

<p>
tagline
</p>


    <a class=\"btn btn-primary btn-large\">
      Learn more
    </a>

</div>




</div></div>


</div>

</div>

<div id=\"outline-container-2\" class=\"outline-3\">
<h3 id=\"sec-2\">页头设置</h3>
<div class=\"outline-text-3\" id=\"text-2\">




<div class=\"row \"><div class=\"span7 \">



<pre class=\"src src-org\"><span style=\"color: #ff4500;\">#+begin_o_blog_page_header</span>
<span style=\"color: #ff4500;\">#+HTML: &lt;h1&gt;Page header&lt;/h1&gt;
Some text
</span><span style=\"color: #ff4500;\">#+end_o_blog_page_header</span>
</pre>


</div><div class=\"span4 \">


<div class=\"page-header\">




<h1>Page header</h1>
<p>
Some text
</p>


</div>




</div></div>


</div>

</div>

<div id=\"outline-container-3\" class=\"outline-3\">
<h3 id=\"sec-3\">使用标注 (label)</h3>
<div class=\"outline-text-3\" id=\"text-3\">


<p>
    标注及注释文本使用 <code>label:TYPE</code> 链接方式,其中的 <code>TYPE</code> 可取值为 <code>default</code>,
    <code>success</code>, <code>warning</code>, <code>important</code>, <code>info</code> 或 <code>reverse</code>. 链接的 URL 部分用作标
    注文本。
</p>


<div class=\"row \"><div class=\"span7 \">



<pre class=\"src src-txt\">[[ob-label:default][Default]]
[[ob-label:success][Success]]
[[ob-label:warning][Warning]]
[[ob-label:important][Important]]
[[ob-label:info][Info]]
[[ob-label:inverse][Inverse]]
</pre>


</div><div class=\"span4 \">

<ul>
<li><span class=\"label label-default\">Default</span>
</li>
<li><span class=\"label label-success\">Success</span>
</li>
<li><span class=\"label label-warning\">Warning</span>
</li>
<li><span class=\"label label-important\">Important</span>
</li>
<li><span class=\"label label-info\">Info</span>
</li>
<li><span class=\"label label-inverse\">Inverse</span>
</li>
</ul>




</div></div>


</div>

</div>

<div id=\"outline-container-4\" class=\"outline-3\">
<h3 id=\"sec-4\">使用标记 (badges)</h3>
<div class=\"outline-text-3\" id=\"text-4\">


<p>
    将提示及未读计数当作标注 (label), 使用链接前缀 <code>badge:TYPE</code>.
</p>


<div class=\"row \"><div class=\"span7 \">



<pre class=\"src src-text\">[[ob-badge:default][Default]]
[[ob-badge:success][Success]]
[[ob-badge:warning][Warning]]
[[ob-badge:important][Important]]
[[ob-badge:info][Info]]
[[ob-badge:inverse][Inverse]]
</pre>


</div><div class=\"span4 \">

<ul>
<li><span class=\"badge badge-default\">Default</span>
</li>
<li><span class=\"badge badge-success\">Success</span>
</li>
<li><span class=\"badge badge-warning\">Warning</span>
</li>
<li><span class=\"badge badge-important\">Important</span>
</li>
<li><span class=\"badge badge-info\">Info</span>
</li>
<li><span class=\"badge badge-inverse\">Inverse</span>
</li>
</ul>




</div></div>


</div>

</div>

<div id=\"outline-container-5\" class=\"outline-3\">
<h3 id=\"sec-5\">使用进度条</h3>
<div class=\"outline-text-3\" id=\"text-5\">


<p>
    用于载入、重定向或动作状态。使用链接前缀 <code>progress:TYPE</code>, 此处的 <code>TYPE</code> 可取
    值 <code>info</code>, <code>success</code>, <code>warning</code> 或 <code>danger</code>. 额外的类 (<code>striped</code> 或
    <code>active</code>) 可用逗号添加。 URL 为进度百分比。
</p>


<div class=\"row \"><div class=\"span7 \">



<pre class=\"src src-text\">[[ob-progress:info][25]]
[[ob-progress:success,striped][50]]
[[ob-progress:warning,striped,active][75]]
[[ob-progress:danger][100]]
</pre>


</div><div class=\"span4 \">

<p>
    <div class=\"progress progress-info\"><div class=\"bar\" style=\"width: 25%;\"></div></div>
    <div class=\"progress progress-success progress-striped\"><div class=\"bar\" style=\"width: 50%;\"></div></div>
    <div class=\"progress progress-warning progress-striped active\"><div class=\"bar\" style=\"width: 75%;\"></div></div>
    <div class=\"progress progress-danger\"><div class=\"bar\" style=\"width: 100%;\"></div></div>
</p>


</div></div>



</div>

</div>

<div id=\"outline-container-6\" class=\"outline-3\">
<h3 id=\"sec-6\">Well</h3>
<div class=\"outline-text-3\" id=\"text-6\">


<p>
Use the well as a simple effect on an element to give it an inset effect.
</p>


<div class=\"row \"><div class=\"span7 \">



<pre class=\"src src-text\"> #+begin_o_blog_well
, Look, I'm in a well!
 #+end_o_blog_well
</pre>


</div><div class=\"span4 \">



<div class=\"well\">


<p>
Look, I'm in a well!
</p>


</div>




</div></div>

</div>
</div>
"

中文测试

导出博文信息 中文测试
属性
id
4
title
"中文测试"
timespamp
(20327 57688)
year
2012
month
3
day
20
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "中文" "a7bac2239fcdcb3a067903d8077c4a07" nil nil])
template
"blog_post.html"
filepath
"tips/2012/03"
filename
"use-chinese"
htmlfile
"tips/2012/03/20_use-chinese.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


这是一个测试条目哟。

博客页面的文件名默认使用 =ob-sanitize-string= 从标题生成, 这样会导致中文标题的博文无法正常生成。因此,对于中文博客,需要在你的 *org* 文档头中添加
: #+FILENAME_SANITIZER: md5

另外的一个办法就是在文件头添加一段你自己定义的 =emacs-lisp= 代码,比如:
: #+begin_example
: #+NAME: my-sanitizer
: #+begin_src emacs-lisp
: (defun el-sanitizer(s)
:   \"Sanitize string S\"
:   (if (equal (ob-sanitize-string s) \"\")
:       (md5 s)
:     (ob-sanitize-string s)))
: #+end_src
: 
: #+CALL: my-sanitizer()
: #+FILENAME_SANITIZER: el-sanitizer
: #+end_example
打开文件后,你需要先将光标移动到 =#+CALL:= 那一行并执行 =C-c C-c=, 然后再执行 =org-publish-blog= 即可。

- 待办事项
  这儿列举了一些中文处理中的问题。具体的解决参见 [[github:exaos/o-blog]].

  1. [X] 中文文件名无法正常生成
     * 现在,使用 =#+FILENAME_SANITIZER: md5= 生成默认为 =YYYY/MM/DD_(MD5).html= 的文件名。
     * 或者在每个条目下添加属性 =CUSTOM_ID=, 生成为 =YYYY/MM/DD_(CUSTOM_ID).html= 形式的文件名。
  2. [X] 博客设置中的 =Copyright=, =About= 及 =Navigation= 等 =SNIPPET= 不能用中文的问题。
  3. [X] 多语言模版支持。你需要在文件头中定义 =#+LANGUAGE: zh=, 然后在 =templates/zh= 目录下放置需要翻译成中文的模版文件即可"
content-html
"<p>
这是一个测试条目哟。
</p>
<p>
博客页面的文件名默认使用 <code>ob-sanitize-string</code> 从标题生成, 这样会导致中文标题的博文无法正常生成。因此,对于中文博客,需要在你的 <b>org</b> 文档头中添加
</p><pre class=\"example\">
#+FILENAME_SANITIZER: md5
</pre>


<p>
另外的一个办法就是在文件头添加一段你自己定义的 <code>emacs-lisp</code> 代码,比如:
</p><pre class=\"example\">
#+begin_example
#+NAME: my-sanitizer
#+begin_src emacs-lisp
(defun el-sanitizer(s)
  \"Sanitize string S\"
  (if (equal (ob-sanitize-string s) \"\")
      (md5 s)
    (ob-sanitize-string s)))
#+end_src

#+CALL: my-sanitizer()
#+FILENAME_SANITIZER: el-sanitizer
#+end_example
</pre>

<p>打开文件后,你需要先将光标移动到 <code>#+CALL:</code> 那一行并执行 <code>C-c C-c</code>, 然后再执行 <code>org-publish-blog</code> 即可。
</p>
<ul>
<li>待办事项
  这儿列举了一些中文处理中的问题。具体的解决参见 <a href=\"#github-exaos-o-blog\">github:exaos/o-blog</a>.

<ol>
<li><code>[X]</code> 中文文件名无法正常生成
<ul>
<li>现在,使用 <code>#+FILENAME_SANITIZER: md5</code> 生成默认为 <code>YYYY/MM/DD_(MD5).html</code> 的文件名。
</li>
<li>或者在每个条目下添加属性 <code>CUSTOM_ID</code>, 生成为 <code>YYYY/MM/DD_(CUSTOM_ID).html</code> 形式的文件名。
</li>
</ul>

</li>
<li><code>[X]</code> 博客设置中的 <code>Copyright</code>, <code>About</code> 及 <code>Navigation</code> 等 <code>SNIPPET</code> 不能用中文的问题。
</li>
<li><code>[X]</code> 多语言模版支持。你需要在文件头中定义 <code>#+LANGUAGE: zh</code>, 然后在 <code>templates/zh</code> 目录下放置需要翻译成中文的模版文件即可
</li>
</ol>

</li>
</ul>

"

使用 Bootstrap 分格

导出博文信息 使用 Bootstrap 分格
属性
id
5
title
"使用 Bootstrap 分格"
timespamp
(20276 4)
year
2012
month
2
day
10
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "Bootstrap" "bootstrap" nil nil])
template
"blog_post.html"
filepath
"tips/2012/02"
filename
"use-bootstrap"
htmlfile
"tips/2012/02/10_use-bootstrap.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


[[http://twitter.github.com/bootstrap/scaffolding.html][Bootstrap scaffolding]] could be defined using both =#+begin_o_blog_row= and
=#+end_o_blog_row= directives (or =<og= =TAB= shortcut). A new column could
be started using =#+o_blog_row_column= single directive (or =<ogr= =TAB=
shortcut).


#+BEGIN_HTML
<div class=\"row show-grid\"><div class=\"span6 \">
#+END_HTML

*Example*

#+begin_src org
  ,#+begin_o_blog_row 2 -1 show-grid
  ,Column 1
  ,#+o_blog_row_column 2
  ,Column 2
  ,#+end_o_blog_row
#+end_src


#+BEGIN_HTML
</div><div class=\"span6 \">
#+END_HTML


*Output*

#+BEGIN_HTML
<div class=\"row show-grid\"><div class=\"span2 offset1\">
#+END_HTML


Column 1

#+BEGIN_HTML
</div><div class=\"span2 \">
#+END_HTML


Column 2


#+BEGIN_HTML
</div></div>
#+END_HTML



#+BEGIN_HTML
</div></div>
#+END_HTML



The syntax is:

#+begin_src org
  ,#+begin_o_blog_row SPAN OFFSET GRID-CLASS
  ,Column 1
  ,#+o_blog_row_column SPAN OFFSET
  ,Column 2
  ,...
  ,#+o_blog_row_column SPAN OFFSET
  ,Column n
  ,#+end_o_blog_row

#+end_src
"
content-html
"<p>
<a href=\"http://twitter.github.com/bootstrap/scaffolding.html\">Bootstrap scaffolding</a> could be defined using both <code>#+begin_o_blog_row</code> and
<code>#+end_o_blog_row</code> directives (or <code>&lt;og</code> <code>TAB</code> shortcut). A new column could
be started using <code>#+o_blog_row_column</code> single directive (or <code>&lt;ogr</code> <code>TAB</code>
shortcut).
</p>



<div class=\"row show-grid\"><div class=\"span6 \">

<p>
<b>Example</b>
</p>



<pre class=\"src src-org\"><span style=\"color: #ff4500;\">#+begin_o_blog_row 2 -1 show-grid</span>
Column 1
#+o_blog_row_column 2
Column 2
<span style=\"color: #ff4500;\">#+end_o_blog_row</span>
</pre>



</div><div class=\"span6 \">


<p>
<b>Output</b>
</p>


<div class=\"row show-grid\"><div class=\"span2 offset1\">


<p>
Column 1
</p>


</div><div class=\"span2 \">


<p>
Column 2
</p>



</div></div>



</div></div>



<p>
The syntax is:
</p>



<pre class=\"src src-org\"><span style=\"color: #ff4500;\">#+begin_o_blog_row SPAN OFFSET GRID-CLASS</span>
Column 1
#+o_blog_row_column SPAN OFFSET
Column 2
...
#+o_blog_row_column SPAN OFFSET
Column n
<span style=\"color: #ff4500;\">#+end_o_blog_row</span>

</pre>

"

添加图标

导出博文信息 添加图标
属性
id
6
title
"添加图标"
timespamp
(20275 61940)
year
2012
month
2
day
10
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "Bootstrap" "bootstrap" nil nil])
template
"blog_post.html"
filepath
"tips/2012/02"
filename
"add-icons"
htmlfile
"tips/2012/02/10_add-icons.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


Icons from [[http://glyphicons.com/][glyphicons]] are supported support by simply naming the icon using
italic style:

#+BEGIN_HTML
<div class=\"row \"><div class=\"span6 \">
#+END_HTML



*Source example*

#+begin_src org
  ,/icon-calendar/ calendar
#+end_src

#+BEGIN_HTML
</div><div class=\"span6 \">
#+END_HTML


*Rendered output*

/icon-calendar/ calendar


#+BEGIN_HTML
</div></div>
#+END_HTML




This could also be used for the top /navbar/ using something like:

#+BEGIN_HTML
<div class=\"row \"><div class=\"span6 \">
#+END_HTML


*Source example*

#+begin_src org

  ,- [[#][/icon-book icon-white/ Documentation]]
  ,  - [[file:../../../templates.html][Templates]]
  ,  - [[file:../../../structures.html][Structures]]
  ,  - [[file:../../../functions.html][Functions]]
  ,  -
  ,  - [[file:../../../faq.html][FAQ]]

  ,- [[#][/icon-file icon-white/ Blog]]
  ,  - [[file:Lisp error in nil: (void-function format%20"%25s/%25s"%20)][Lisp error in nil: (void-variable "Tips")]]
  ,  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]
  ,  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]
  ,  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]
  ,  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]

  ,- [[file:../../../tags/index.html][/icon-tags icon-white/ Tags]]

#+end_src

#+BEGIN_HTML
</div><div class=\"span6 \">
#+END_HTML


*Rendered output*


#+begin_html
<div class=\"navbar\">
<div class=\"navbar-inner\">
<div class=\"container\">
<div class=\"nav-collapse\">
#+end_html

- [[#][/icon-book icon-white/ Documentation]]
  - [[file:../../../templates.html][Templates]]
  - [[file:../../../structures.html][Structures]]
  - [[file:../../../functions.html][Functions]]
  -
  - [[file:../../../faq.html][FAQ]]

- [[#][/icon-file icon-white/ Blog]]
  - [[file:Lisp error in nil: (void-function format%20"%25s/%25s"%20)][Lisp error in nil: (void-variable "Tips")]]
  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]
  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]
  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]
  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]

- [[file:../../../tags/index.html][/icon-tags icon-white/ Tags]]

#+begin_html
</div>
</div>
</div>
</div>
#+end_html

Please note the blank line between menu items. if blanks are omitted, the
rendered result might be damaged.


#+BEGIN_HTML
</div></div>
#+END_HTML


"
content-html
"<p>
Icons from <a href=\"http://glyphicons.com/\">glyphicons</a> are supported support by simply naming the icon using
italic style:
</p>


<div class=\"row \"><div class=\"span6 \">



<p>
<b>Source example</b>
</p>



<pre class=\"src src-org\"><span style=\"font-style: italic;\">/icon-calendar/</span> calendar
</pre>


</div><div class=\"span6 \">


<p>
<b>Rendered output</b>
</p>
<p>
<i>icon-calendar</i> calendar
</p>



</div></div>




<p>
This could also be used for the top <i>navbar</i> using something like:
</p>


<div class=\"row \"><div class=\"span6 \">


<p>
<b>Source example</b>
</p>



<pre class=\"src src-org\">- <span style=\"color: #0000ff;\">/icon-book icon-white/ Documentation</span>
  - <span style=\"color: #0000ff;\">Templates</span>
  - <span style=\"color: #0000ff;\">Structures</span>
  - <span style=\"color: #0000ff;\">Functions</span>
  -
  - <span style=\"color: #0000ff;\">FAQ</span>

- <span style=\"color: #0000ff;\">/icon-file icon-white/ Blog</span>
  - <span style=\"color: #0000ff;\">Lisp error in nil: (void-variable "Tips")</span>
  - <span style=\"color: #0000ff;\">Lisp error in nil: (void-variable "Tips")</span>
  - <span style=\"color: #0000ff;\">Lisp error in nil: (void-variable "Tips")</span>
  - <span style=\"color: #0000ff;\">Lisp error in nil: (void-variable "Tips")</span>
  - <span style=\"color: #0000ff;\">Lisp error in nil: (void-variable "Tips")</span>

- <span style=\"color: #0000ff; font-style: italic;\">/icon-tags icon-white/</span><span style=\"color: #0000ff;\"> Tags</span>

</pre>


</div><div class=\"span6 \">


<p>
<b>Rendered output</b>
</p>



<div class=\"navbar\">
<div class=\"navbar-inner\">
<div class=\"container\">
<div class=\"nav-collapse\">

<ul>
<li><a href=\"#\"><i>icon-book icon-white</i> Documentation</a>
<ul>
<li><a href=\"../../../templates.html\">Templates</a>
</li>
<li><a href=\"../../../structures.html\">Structures</a>
</li>
<li><a href=\"../../../functions.html\">Functions</a>
</li>
<li>
</li>
<li><a href=\"../../../faq.html\">FAQ</a>

</li>
</ul>

</li>
<li><a href=\"#\"><i>icon-file icon-white</i> Blog</a>
<ul>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>
</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>
</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>
</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>
</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>

</li>
</ul>

</li>
<li><a href=\"../../../tags/index.html\"><i>icon-tags icon-white</i> Tags</a>
</li>
</ul>




</div>
</div>
</div>
</div>

<p>
Please note the blank line between menu items. if blanks are omitted, the
rendered result might be damaged.
</p>



</div></div>


"

使用 modal 显示源代码

导出博文信息 使用 modal 显示源代码
属性
id
7
title
"使用 modal 显示源代码"
timespamp
(20275 57980)
year
2012
month
2
day
9
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "Bootstrap" "bootstrap" nil nil])
template
"blog_post.html"
filepath
"tips/2012/02"
filename
"use-modal"
htmlfile
"tips/2012/02/09_use-modal.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


The [[http://twitter.github.com/bootstrap/javascript.html#modals][Modal]] bootstrap script can be used to display the content of an external
file in a modal window. The magic line is:

#+begin_src org
  ,#+O_BLOG_SOURCE: path/to/file [mode]
#+end_src

The /org template shorcut/ is =<os= =TAB=. Two parameters might be used:
- The mandatory =/path/to/file= which is the path to the file from which
  content should be read.
- The optional =mode= which could be determined by if omitted.

这是显示 =README-zh.md= 文件的示例:

#+BEGIN_HTML
<div class=\"o-blog-source\"><a class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#readme-zhmd\" ><i class=\"icon-file icon-white\"></i>&nbsp;README-zh.md</a></div><div class=\"modal fade hide\" id=\"readme-zhmd\"><div class=\"modal-header\"><a class=\"close\" data-dismiss=\"modal\">×</a><h3>README-zh.md</h3></div><div class=\"modal-body\"><pre>
<span style=\"color: #87cefa; font-weight: bold;\"># o-blog &#24555;&#36895;&#20837;&#38376;</span>

<span style=\"color: #b0c4de;\">- </span>&#22914;&#20309;&#20351;&#29992; <span style=\"color: #00ffff;\">[o-blog]</span><span style=\"color: #ffa07a;\">(https://github.com/renard/o-blog)</span>.
<span style=\"color: #b0c4de;\">- </span><span style=\"color: #00ffff;\">[&#33521;&#25991;&#28436;&#31034;&#31449;&#28857;]</span><span style=\"color: #ffa07a;\">(http://renard.github.com/o-blog)</span>.
<span style=\"color: #b0c4de;\">- </span><span style=\"color: #00ffff;\">[&#20013;&#25991;&#28436;&#31034;&#31449;&#28857;]</span><span style=\"color: #ffa07a;\">(http://exaos.github.com/o-blog)</span>.


<span style=\"color: #87cefa; font-weight: bold;\">## &#24555;&#36895;&#20837;&#38376;&#25351;&#21335;</span>
&#24320;&#22987;&#20043;&#21069;&#65292;&#20320;&#38656;&#35201;&#26377;&#65306;

<span style=\"color: #b0c4de;\">- </span><span style=\"color: #00ffff;\">[emacs]</span><span style=\"color: #ffa07a;\">(http:www.gnu.org/s/emacs)</span> (&#20551;&#35774;&#20320;&#24050;&#32463;&#26377;&#20102;)
<span style=\"color: #b0c4de;\">- </span><span style=\"color: #00ffff;\">[org-mode]</span><span style=\"color: #ffa07a;\">(http://orgmode.org/)</span> (&#21516;&#19978;)

&#22914;&#26524;&#27809;&#26377;&#36825;&#20123;&#31243;&#24207;&#65292;&#20320;&#24212;&#35813;&#20808;&#23433;&#35013;&#22909;&#23427;&#20204;&#12290;

<span style=\"color: #87cefa; font-weight: bold;\">### &#35774;&#32622;</span>

#### &#20351;&#29992; <span style=\"color: #7fffd4;\">`el-get`</span>

&#22914;&#26524;&#20320;&#20351;&#29992; <span style=\"color: #00ffff;\">[el-get]</span><span style=\"color: #ffa07a;\">(https://github.com/dimitri/el-get)</span>, &#23433;&#35013;&#24456;&#23481;&#26131;&#12290;&#20320;&#21482;&#38656;&#35201;&#23558;
<span style=\"color: #7fffd4;\">`o-blog`</span> &#28155;&#21152;&#21040; <span style=\"color: #7fffd4;\">`el-get-sources`</span> &#20013;&#65292;&#28982;&#21518;&#25191;&#34892; <span style=\"color: #7fffd4;\">`M-x el-get-install o-blog`</span>.

&#22914;&#26524;&#20320;&#30340; <span style=\"color: #7fffd4;\">`el-get`</span> &#29256;&#26412;&#20026; 4 &#25110;&#20197;&#19978;&#65292;&#20320;&#21482;&#38656;&#35201;&#25191;&#34892;: <span style=\"color: #7fffd4;\">`M-x el-get-install o-blog`</span>.

<span style=\"color: #87cefa; font-weight: bold;\">#### &#25163;&#21160;&#35774;&#32622;</span>
&#39318;&#20808;&#20174; <span style=\"color: #00ffff;\">[Github]</span><span style=\"color: #ffa07a;\">(http://github.com)</span> &#20811;&#38534;&#36825;&#20010; <span style=\"color: #eedd82; font-style: italic;\">*git*</span> &#28304;&#30721;&#20179;&#24211;&#12290;

<span style=\"color: #7fffd4;\">```</span>
cd ~/.emacs.d
git clone <span style=\"color: #00ffff;\">https://github.com/renard/o-blog.git</span>
<span style=\"color: #7fffd4;\">```</span>

&#23558;&#21518;&#38754;&#30340;&#20195;&#30721;&#28155;&#21152;&#21040;&#20320;&#30340; <span style=\"color: #7fffd4;\">`~/.emacs.d/init.el`</span> &#25991;&#20214;&#20013;&#65306;

<span style=\"color: #7fffd4;\">```</span>
(add-to-list 'load-path \"~/.emacs.d/o-blog\")
(require 'o-blog)
<span style=\"color: #7fffd4;\">```</span>

<span style=\"color: #87cefa; font-weight: bold;\">### &#21457;&#24067;</span>

&#25171;&#24320;&#25991;&#20214; <span style=\"color: #7fffd4;\">`~/.emacs.d/o-blog/example/sample.org`</span> &#28982;&#21518;&#25191;&#34892; <span style=\"color: #7fffd4;\">`M-x org-publish-blog`</span>.
&#29983;&#25104;&#30340;&#31449;&#28857;&#23558;&#20250;&#33258;&#21160;&#21457;&#24067;&#22312; <span style=\"color: #7fffd4;\">`~/.emacs.d/o-blog/out`</span> &#30446;&#24405;&#19979;&#12290;

&#28982;&#21518;&#65292;&#35814;&#24773;&#21442;&#35265; <span style=\"color: #7fffd4;\">`example/out/blog/index.html`</span> &#21450; <span style=\"color: #7fffd4;\">`example/out/todo.html`</span>.
</pre></div></div>
#+END_HTML


这是显示 elisp 代码的示例:

#+BEGIN_HTML
<div class=\"o-blog-source\"><a class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#sample-initel\" ><i class=\"icon-file icon-white\"></i>&nbsp;sample-init.el</a></div><div class=\"modal fade hide\" id=\"sample-initel\"><div class=\"modal-header\"><a class=\"close\" data-dismiss=\"modal\">×</a><h3>sample-init.el</h3></div><div class=\"modal-body\"><pre>
<span style=\"color: #ff4500;\">;;; </span><span style=\"color: #ff4500;\">sample-init.el --- sample init file to be used to debug o-blog
</span>
<span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Copyright &#169; 2012 S&#233;bastien Gross &lt;seb&#8226;&#593;&#428;&#8226;chezwam&#8226;&#598;&#629;&#648;&#8226;org&gt;
</span>
<span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Author: S&#233;bastien Gross &lt;seb&#8226;&#593;&#428;&#8226;chezwam&#8226;&#598;&#629;&#648;&#8226;org&gt;
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Keywords: emacs, 
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Created: 2012-03-20
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Last changed: 2012-03-26 16:36:31
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/
</span>
<span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">This file is NOT part of GNU Emacs.
</span>
<span style=\"color: #ff4500;\">;;; </span><span style=\"color: #ff4500;\">Commentary:
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">
</span>

<span style=\"color: #ff4500;\">;;; </span><span style=\"color: #ff4500;\">Code:
</span>

(<span style=\"color: #00ffff;\">defun</span> <span style=\"color: #87cefa;\">ob-build-sample</span> ()
  (<span style=\"color: #00ffff;\">let*</span> ((d default-directory)
         (sample (format <span style=\"color: #ffa07a;\">\"%s/.emacs.d/o-blog/example/sample.org\"</span> d))
         (debugger
          (<span style=\"color: #00ffff;\">lambda</span> (<span style=\"color: #98fb98;\">&amp;rest</span> debugger-args)
            (<span style=\"color: #00ffff;\">let*</span> ((trace (<span style=\"color: #00ffff;\">with-temp-buffer</span>
                            (insert (<span style=\"color: #00ffff;\">with-output-to-string</span> (backtrace)))
                            (beginning-of-buffer)
                            <span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">error begins on line 16
</span>                            <span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">line stats with \"  signal(error ...\"
</span>                            (goto-line 16)
                            (goto-char (point-at-bol))
                            <span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Remove null chars
</span>                            (replace-regexp-in-string
                              (char-to-string 0) <span style=\"color: #ffa07a;\">\"^@\"</span>
                              (buffer-substring (point) (point-max))))))
              (o-blog-bug-report trace))))
         (debug-on-error t)
         print-length print-level)
    (add-to-list 'load-path (format <span style=\"color: #ffa07a;\">\"%s/.emacs.d/org-mode/lisp\"</span> d))
    (add-to-list 'load-path (format <span style=\"color: #ffa07a;\">\"%s/.emacs.d/org-mode/contrib/lisp\"</span> d))
    (add-to-list 'load-path (format <span style=\"color: #ffa07a;\">\"%s/.emacs.d/o-blog\"</span> d))
    (<span style=\"color: #00ffff;\">require</span> '<span style=\"color: #7fffd4;\">o-blog</span>)
    (print
      (concat
        (emacs-version) <span style=\"color: #ffa07a;\">\"\\n\"</span>
        (org-version) <span style=\"color: #ffa07a;\">\"\\n\"</span>
        (o-blog-version) <span style=\"color: #ffa07a;\">\"\\n\"</span>))
    (find-file sample)
    (org-publish-blog sample)
    (kill-emacs)))
</pre></div></div>
#+END_HTML

"
content-html
"<p>
The <a href=\"http://twitter.github.com/bootstrap/javascript.html#modals\">Modal</a> bootstrap script can be used to display the content of an external
file in a modal window. The magic line is:
</p>



<pre class=\"src src-org\"><span style=\"color: #ff4500;\">#+O_BLOG_SOURCE: path/to/file [mode]</span>
</pre>


<p>
The <i>org template shorcut</i> is <code>&lt;os</code> <code>TAB</code>. Two parameters might be used:
</p><ul>
<li>The mandatory <code>/path/to/file</code> which is the path to the file from which
  content should be read.
</li>
<li>The optional <code>mode</code> which could be determined by if omitted.
</li>
</ul>


<p>
这是显示 <code>README-zh.md</code> 文件的示例:
</p>


<div class=\"o-blog-source\"><a class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#readme-zhmd\" ><i class=\"icon-file icon-white\"></i>&nbsp;README-zh.md</a></div><div class=\"modal fade hide\" id=\"readme-zhmd\"><div class=\"modal-header\"><a class=\"close\" data-dismiss=\"modal\">×</a><h3>README-zh.md</h3></div><div class=\"modal-body\"><pre>
<span style=\"color: #87cefa; font-weight: bold;\"># o-blog &#24555;&#36895;&#20837;&#38376;</span>

<span style=\"color: #b0c4de;\">- </span>&#22914;&#20309;&#20351;&#29992; <span style=\"color: #00ffff;\">[o-blog]</span><span style=\"color: #ffa07a;\">(https://github.com/renard/o-blog)</span>.
<span style=\"color: #b0c4de;\">- </span><span style=\"color: #00ffff;\">[&#33521;&#25991;&#28436;&#31034;&#31449;&#28857;]</span><span style=\"color: #ffa07a;\">(http://renard.github.com/o-blog)</span>.
<span style=\"color: #b0c4de;\">- </span><span style=\"color: #00ffff;\">[&#20013;&#25991;&#28436;&#31034;&#31449;&#28857;]</span><span style=\"color: #ffa07a;\">(http://exaos.github.com/o-blog)</span>.


<span style=\"color: #87cefa; font-weight: bold;\">## &#24555;&#36895;&#20837;&#38376;&#25351;&#21335;</span>
&#24320;&#22987;&#20043;&#21069;&#65292;&#20320;&#38656;&#35201;&#26377;&#65306;

<span style=\"color: #b0c4de;\">- </span><span style=\"color: #00ffff;\">[emacs]</span><span style=\"color: #ffa07a;\">(http:www.gnu.org/s/emacs)</span> (&#20551;&#35774;&#20320;&#24050;&#32463;&#26377;&#20102;)
<span style=\"color: #b0c4de;\">- </span><span style=\"color: #00ffff;\">[org-mode]</span><span style=\"color: #ffa07a;\">(http://orgmode.org/)</span> (&#21516;&#19978;)

&#22914;&#26524;&#27809;&#26377;&#36825;&#20123;&#31243;&#24207;&#65292;&#20320;&#24212;&#35813;&#20808;&#23433;&#35013;&#22909;&#23427;&#20204;&#12290;

<span style=\"color: #87cefa; font-weight: bold;\">### &#35774;&#32622;</span>

#### &#20351;&#29992; <span style=\"color: #7fffd4;\">`el-get`</span>

&#22914;&#26524;&#20320;&#20351;&#29992; <span style=\"color: #00ffff;\">[el-get]</span><span style=\"color: #ffa07a;\">(https://github.com/dimitri/el-get)</span>, &#23433;&#35013;&#24456;&#23481;&#26131;&#12290;&#20320;&#21482;&#38656;&#35201;&#23558;
<span style=\"color: #7fffd4;\">`o-blog`</span> &#28155;&#21152;&#21040; <span style=\"color: #7fffd4;\">`el-get-sources`</span> &#20013;&#65292;&#28982;&#21518;&#25191;&#34892; <span style=\"color: #7fffd4;\">`M-x el-get-install o-blog`</span>.

&#22914;&#26524;&#20320;&#30340; <span style=\"color: #7fffd4;\">`el-get`</span> &#29256;&#26412;&#20026; 4 &#25110;&#20197;&#19978;&#65292;&#20320;&#21482;&#38656;&#35201;&#25191;&#34892;: <span style=\"color: #7fffd4;\">`M-x el-get-install o-blog`</span>.

<span style=\"color: #87cefa; font-weight: bold;\">#### &#25163;&#21160;&#35774;&#32622;</span>
&#39318;&#20808;&#20174; <span style=\"color: #00ffff;\">[Github]</span><span style=\"color: #ffa07a;\">(http://github.com)</span> &#20811;&#38534;&#36825;&#20010; <span style=\"color: #eedd82; font-style: italic;\">*git*</span> &#28304;&#30721;&#20179;&#24211;&#12290;

<span style=\"color: #7fffd4;\">```</span>
cd ~/.emacs.d
git clone <span style=\"color: #00ffff;\">https://github.com/renard/o-blog.git</span>
<span style=\"color: #7fffd4;\">```</span>

&#23558;&#21518;&#38754;&#30340;&#20195;&#30721;&#28155;&#21152;&#21040;&#20320;&#30340; <span style=\"color: #7fffd4;\">`~/.emacs.d/init.el`</span> &#25991;&#20214;&#20013;&#65306;

<span style=\"color: #7fffd4;\">```</span>
(add-to-list 'load-path \"~/.emacs.d/o-blog\")
(require 'o-blog)
<span style=\"color: #7fffd4;\">```</span>

<span style=\"color: #87cefa; font-weight: bold;\">### &#21457;&#24067;</span>

&#25171;&#24320;&#25991;&#20214; <span style=\"color: #7fffd4;\">`~/.emacs.d/o-blog/example/sample.org`</span> &#28982;&#21518;&#25191;&#34892; <span style=\"color: #7fffd4;\">`M-x org-publish-blog`</span>.
&#29983;&#25104;&#30340;&#31449;&#28857;&#23558;&#20250;&#33258;&#21160;&#21457;&#24067;&#22312; <span style=\"color: #7fffd4;\">`~/.emacs.d/o-blog/out`</span> &#30446;&#24405;&#19979;&#12290;

&#28982;&#21518;&#65292;&#35814;&#24773;&#21442;&#35265; <span style=\"color: #7fffd4;\">`example/out/blog/index.html`</span> &#21450; <span style=\"color: #7fffd4;\">`example/out/todo.html`</span>.
</pre></div></div>


<p>
这是显示 elisp 代码的示例:
</p>


<div class=\"o-blog-source\"><a class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#sample-initel\" ><i class=\"icon-file icon-white\"></i>&nbsp;sample-init.el</a></div><div class=\"modal fade hide\" id=\"sample-initel\"><div class=\"modal-header\"><a class=\"close\" data-dismiss=\"modal\">×</a><h3>sample-init.el</h3></div><div class=\"modal-body\"><pre>
<span style=\"color: #ff4500;\">;;; </span><span style=\"color: #ff4500;\">sample-init.el --- sample init file to be used to debug o-blog
</span>
<span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Copyright &#169; 2012 S&#233;bastien Gross &lt;seb&#8226;&#593;&#428;&#8226;chezwam&#8226;&#598;&#629;&#648;&#8226;org&gt;
</span>
<span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Author: S&#233;bastien Gross &lt;seb&#8226;&#593;&#428;&#8226;chezwam&#8226;&#598;&#629;&#648;&#8226;org&gt;
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Keywords: emacs, 
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Created: 2012-03-20
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Last changed: 2012-03-26 16:36:31
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/
</span>
<span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">This file is NOT part of GNU Emacs.
</span>
<span style=\"color: #ff4500;\">;;; </span><span style=\"color: #ff4500;\">Commentary:
</span><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">
</span>

<span style=\"color: #ff4500;\">;;; </span><span style=\"color: #ff4500;\">Code:
</span>

(<span style=\"color: #00ffff;\">defun</span> <span style=\"color: #87cefa;\">ob-build-sample</span> ()
  (<span style=\"color: #00ffff;\">let*</span> ((d default-directory)
         (sample (format <span style=\"color: #ffa07a;\">\"%s/.emacs.d/o-blog/example/sample.org\"</span> d))
         (debugger
          (<span style=\"color: #00ffff;\">lambda</span> (<span style=\"color: #98fb98;\">&amp;rest</span> debugger-args)
            (<span style=\"color: #00ffff;\">let*</span> ((trace (<span style=\"color: #00ffff;\">with-temp-buffer</span>
                            (insert (<span style=\"color: #00ffff;\">with-output-to-string</span> (backtrace)))
                            (beginning-of-buffer)
                            <span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">error begins on line 16
</span>                            <span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">line stats with \"  signal(error ...\"
</span>                            (goto-line 16)
                            (goto-char (point-at-bol))
                            <span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">Remove null chars
</span>                            (replace-regexp-in-string
                              (char-to-string 0) <span style=\"color: #ffa07a;\">\"^@\"</span>
                              (buffer-substring (point) (point-max))))))
              (o-blog-bug-report trace))))
         (debug-on-error t)
         print-length print-level)
    (add-to-list 'load-path (format <span style=\"color: #ffa07a;\">\"%s/.emacs.d/org-mode/lisp\"</span> d))
    (add-to-list 'load-path (format <span style=\"color: #ffa07a;\">\"%s/.emacs.d/org-mode/contrib/lisp\"</span> d))
    (add-to-list 'load-path (format <span style=\"color: #ffa07a;\">\"%s/.emacs.d/o-blog\"</span> d))
    (<span style=\"color: #00ffff;\">require</span> '<span style=\"color: #7fffd4;\">o-blog</span>)
    (print
      (concat
        (emacs-version) <span style=\"color: #ffa07a;\">\"\\n\"</span>
        (org-version) <span style=\"color: #ffa07a;\">\"\\n\"</span>
        (o-blog-version) <span style=\"color: #ffa07a;\">\"\\n\"</span>))
    (find-file sample)
    (org-publish-blog sample)
    (kill-emacs)))
</pre></div></div>

"

警告

导出博文信息 警告
属性
id
8
title
"警告"
timespamp
(20242 51488)
year
2012
month
1
day
15
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil])
template
"blog_post.html"
filepath
"tips/2012/01"
filename
"warning"
htmlfile
"tips/2012/01/15_warning.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


Alerts are declared in =o_blog_alert= blocks. There are 4 types of
them:

 - info
 - success
 - warning
 - error

#+begin_src org
  ,#+begin_o_blog_alert <TYPE> <title>
  ,Text of the alert
  ,#+end_o_blog_alert
#+end_src


#+BEGIN_HTML
<div class=\"alert alert-error\"><p class=\"alert-heading\"></p>
#+END_HTML


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.


#+BEGIN_HTML
</div>
#+END_HTML



#+BEGIN_HTML
<div class=\"alert alert-error\"><p class=\"alert-heading\">Danger</p>
#+END_HTML


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.


#+BEGIN_HTML
</div>
#+END_HTML


#+BEGIN_HTML
<div class=\"alert alert-warning\"><p class=\"alert-heading\">Caution</p>
#+END_HTML


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.


#+BEGIN_HTML
</div>
#+END_HTML




#+BEGIN_HTML
<div class=\"alert alert-success\"><p class=\"alert-heading\">Tip</p>
#+END_HTML


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.


#+BEGIN_HTML
</div>
#+END_HTML


#+BEGIN_HTML
<div class=\"alert alert-info\"><p class=\"alert-heading\">Information</p>
#+END_HTML


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.


#+BEGIN_HTML
</div>
#+END_HTML

"
content-html
"<p>
Alerts are declared in <code>o_blog_alert</code> blocks. There are 4 types of
them:
</p>
<ul>
<li>info
</li>
<li>success
</li>
<li>warning
</li>
<li>error
</li>
</ul>





<pre class=\"src src-org\"><span style=\"color: #ff4500;\">#+begin_o_blog_alert &lt;TYPE&gt; &lt;title&gt;</span>
Text of the alert
<span style=\"color: #ff4500;\">#+end_o_blog_alert</span>
</pre>



<div class=\"alert alert-error\"><p class=\"alert-heading\"></p>


<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.
</p>



</div>



<div class=\"alert alert-error\"><p class=\"alert-heading\">Danger</p>


<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.
</p>



</div>


<div class=\"alert alert-warning\"><p class=\"alert-heading\">Caution</p>


<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.
</p>



</div>




<div class=\"alert alert-success\"><p class=\"alert-heading\">Tip</p>


<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.
</p>



</div>


<div class=\"alert alert-info\"><p class=\"alert-heading\">Information</p>


<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.
</p>



</div>

"

一些 HTML5 示例

导出博文信息 一些 HTML5 示例
属性
id
9
title
"一些 HTML5 示例"
timespamp
(20236 13784)
year
2012
month
1
day
10
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "html 5" "html-5" nil nil])
template
"blog_post.html"
filepath
"tips/2012/01"
filename
"html5-example"
htmlfile
"tips/2012/01/10_html5-example.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


** tag: <details>

Works only with chrome.

#+HTML: <details>
#+HTML: <summary>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</summary>
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
- Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
- Sed diam.
- Nam vestibulum accumsan nisl.
#+HTML: </details>

#+begin_src org
  ,#+HTML: <details>
  ,#+HTML: <summary>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</summary>
  ,- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  ,- Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
  ,- Sed diam.
  ,- Nam vestibulum accumsan nisl.
  ,#+HTML: </details>
#+end_src
"
content-html
"<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">tag: &lt;details&gt;</h3>
<div class=\"outline-text-3\" id=\"text-1\">


<p>
Works only with chrome.
</p>


<details>
<summary>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</summary>
<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</li>
<li>Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
</li>
<li>Sed diam.
</li>
<li>Nam vestibulum accumsan nisl.
</li>
</ul>


</details>


<pre class=\"src src-org\"><span style=\"color: #ff4500;\">#+HTML:</span><span style=\"color: #ff4500;\"> </span><span style=\"color: #7f7f7f;\">&lt;details&gt;</span>
<span style=\"color: #ff4500;\">#+HTML:</span><span style=\"color: #ff4500;\"> </span><span style=\"color: #7f7f7f;\">&lt;summary&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit&lt;/summary&gt;</span>
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
- Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
- Sed diam.
- Nam vestibulum accumsan nisl.
<span style=\"color: #ff4500;\">#+HTML:</span><span style=\"color: #ff4500;\"> </span><span style=\"color: #7f7f7f;\">&lt;/details&gt;</span>
</pre>

</div>
</div>
"

一些 org 语法示例

导出博文信息 一些 org 语法示例
属性
id
10
title
"一些 org 语法示例"
timespamp
(20231 47764)
year
2012
month
1
day
7
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "org" "org" nil nil])
template
"blog_post.html"
filepath
"tips/2012/01"
filename
"syntax-org-mode"
htmlfile
"tips/2012/01/07_syntax-org-mode.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


** Titles

This is a level 1

*** Level 2

This is a level 2


**** Level 3

This is a level 3

***** Level 4

This is a level 4

****** Level 5

This is a level 5

******* Level 6

This is a level 6


Up to 6 levels of indentation could be used.

** Praragaphs

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+html: <div class=\"two-cols\">

Nullam eu ante vel est convallis dignissim. Fusce suscipit, wisi nec
facilisis facilisis, est dui fermentum leo, quis tempor ligula erat quis
odio. Nunc porta vulputate tellus. Nunc rutrum turpis sed pede. Sed
bibendum. Aliquam posuere. Nunc aliquet, augue nec adipiscing interdum,
lacus tellus malesuada massa, quis varius mi purus non odio. Pellentesque
condimentum, magna ut suscipit hendrerit, ipsum augue ornare nulla, non
luctus diam neque sit amet urna. Curabitur vulputate vestibulum lorem. Fusce
sagittis, libero non molestie mollis, magna orci ultrices dolor, at
vulputate neque nulla lacinia eros. Sed id ligula quis est convallis
tempor. Curabitur lacinia pulvinar nibh. Nam a sapien.

Pellentesque dapibus suscipit ligula. Donec posuere augue in quam. Etiam vel
tortor sodales tellus ultricies commodo. Suspendisse potenti. Aenean in sem
ac leo mollis blandit. Donec neque quam, dignissim in, mollis nec, sagittis
eu, wisi. Phasellus lacus. Etiam laoreet quam sed arcu. Phasellus at dui in
ligula mollis ultricies. Integer placerat tristique nisl. Praesent
augue. Fusce commodo. Vestibulum convallis, lorem a tempus semper, dui dui
euismod elit, vitae placerat urna tortor vitae lacus. Nullam libero mauris,
consequat quis, varius et, dictum id, arcu. Mauris mollis tincidunt
felis. Aliquam feugiat tellus ut neque. Nulla facilisis, risus a rhoncus
fermentum, tellus tellus lacinia purus, et dictum nunc justo sit amet elit.

#+html: </div>


#+begin_verse
Great clouds overhead
Tiny black birds rise and fall
Snow covers Emacs

-- AlexSchroeder
#+end_verse

#+begin_quote
Everything should be made as simple as possible,
but not any simpler -- Albert Einstein
#+end_quote

#+BEGIN_CENTER
Everything should be made as simple as possible, \\\\
but not any simpler
#+END_CENTER

** Lists

As taken from org manual:

My favorite scenes are (in this order)
        1. The attack of the Rohirrim
        2. Eowyn's fight with the witch king
           + this was already my favorite scene in the book
           + I really like Miranda Otto.
        3. Peter Jackson being shot by Legolas
           - on DVD only
           He makes a really funny face when it happens.
But in the end, no individual scenes matter but the film as a whole.
Important actors in this film are:
        - Elijah Wood :: He plays Frodo
        - Sean Austin :: He plays Sam, Frodo's friend.  I still remember
          him very well from his role as Mikey Walsh in The Goonies.

** Footnotes

The Org homepage[fn:1] now looks a lot better than it used to.

[fn:1] The link is: http://orgmode.org

** Emphasis and monospace

You can make words *bold*, /italic/, _underlined_, =code= and ~verbatim~,
and, if you must, ‘+strike-through+’. Text in the code and verbatim string
is not processed for Org mode specific syntax; it is exported verbatim.

** Horizontal rules

A line consisting of only dashes, and at least 5 of them, will be exported
as a horizontal line (‘<hr/>’ in HTML and \\hrule in LaTeX).

------

As shown previously.

** Comment lines

Lines starting with ‘#’ in column zero are treated as comments and will
never be exported. If you want an indented line to be treated as a comment,
start it with ‘#+ ’. Also entire subtrees starting with the word ‘COMMENT’
will never be exported. Finally, regions surrounded by ‘#+BEGIN\\_COMMENT’
... ‘#+END\\_COMMENT’ will not be exported.

#+begin_comment
C-c ;
Toggle the COMMENT keyword at the beginning of an entry.
#+end_comment

** Images and Tables

Table

#+CAPTION: This is the caption for the next table (or link)
#+LABEL:   tbl:basic-data
|----------+----------+----------+----------+----------------------------------------------------------------------|
| Header 1 | Header 2 | Header 3 | Header 4 | Header 5                                                             |
|----------+----------+----------+----------+----------------------------------------------------------------------|
|      1.1 |      1.2 |      1.3 | X        | This /cell/ has a *very* =long= ~line~ _with_  _{special} ^{layouts} |
|      2.1 |      2.2 |      3.3 | Y        |                                                                      |
|----------+----------+----------+----------+----------------------------------------------------------------------|
|      3.1 |      3.1 |      C.1 | D.1      | E.1                                                                  |
|----------+----------+----------+----------+----------------------------------------------------------------------|


Image

#+CAPTION: This is the caption for the next figure link (or table)
#+LABEL:   fig:SED-HR4049
[[file:../../../tips/2012/01/07_syntax-org-mode/200px-Org-mode-unicorn.svg.png][file:../../../tips/2012/01/07_syntax-org-mode/org-mode-unicorn.png]]

** Literal examples

#+BEGIN_EXAMPLE
Some example from a text file.
#+END_EXAMPLE


Here is an example
        : Some example from a text file.

#+BEGIN_SRC emacs-lisp
  (defun org-xor (a b)
    \"Exclusive or.\"
    (if a (not b) b))
#+END_SRC

#+BEGIN_SRC emacs-lisp -n -r
  (save-excursion                  (ref:sc)
     (goto-char (point-min)))       (ref:jump)
#+END_SRC

In line [[(sc)]] we remember the current position.  [[(jump)][Line (jump)]]
jumps to point-min.

** Special symbols

Angles are written as Greek letters \\alpha, \\beta and \\gamma.

** Subscripts and superscripts

The mass of the sun is M_sun = 1.989 x 10^30 kg.  The radius of
the sun is R_{sun} = 6.96 x 10^8 m.

** links

- outsite (page): [[https://github.com/renard/o-blog][/o-blog/ home]].
- [[Creating a blog]]
- insite (file): [[file:o-blog.el]]
- in page (anchor): [[Literal examples]]"
content-html
"<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">Titles</h3>
<div class=\"outline-text-3\" id=\"text-1\">


<p>
This is a level 1
</p>

</div>

<div id=\"outline-container-1-1\" class=\"outline-4\">
<h4 id=\"sec-1-1\">Level 2</h4>
<div class=\"outline-text-4\" id=\"text-1-1\">


<p>
This is a level 2
</p>


</div>

<div id=\"outline-container-1-1-1\" class=\"outline-5\">
<h5 id=\"sec-1-1-1\">Level 3</h5>
<div class=\"outline-text-5\" id=\"text-1-1-1\">


<p>
This is a level 3
</p>

</div>

<div id=\"outline-container-1-1-1-1\" class=\"outline-6\">
<h6 id=\"sec-1-1-1-1\">Level 4</h6>
<div class=\"outline-text-6\" id=\"text-1-1-1-1\">


<p>
This is a level 4
</p>

</div>

<div id=\"outline-container-1-1-1-1-1\" class=\"outline-7\">
<h7 id=\"sec-1-1-1-1-1\">Level 5</h7>
<div class=\"outline-text-7\" id=\"text-1-1-1-1-1\">


<p>
This is a level 5
</p>

</div>

<div id=\"outline-container-1-1-1-1-1-1\" class=\"outline-8\">
<h8 id=\"sec-1-1-1-1-1-1\">Level 6</h8>
<div class=\"outline-text-8\" id=\"text-1-1-1-1-1-1\">


<p>
This is a level 6
</p>

<p>
Up to 6 levels of indentation could be used.
</p>
</div>
</div>
</div>
</div>
</div>
</div>

</div>

<div id=\"outline-container-2\" class=\"outline-3\">
<h3 id=\"sec-2\">Praragaphs</h3>
<div class=\"outline-text-3\" id=\"text-2\">


<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis
dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.
</p>


<div class=\"two-cols\">

<p>
Nullam eu ante vel est convallis dignissim. Fusce suscipit, wisi nec
facilisis facilisis, est dui fermentum leo, quis tempor ligula erat quis
odio. Nunc porta vulputate tellus. Nunc rutrum turpis sed pede. Sed
bibendum. Aliquam posuere. Nunc aliquet, augue nec adipiscing interdum,
lacus tellus malesuada massa, quis varius mi purus non odio. Pellentesque
condimentum, magna ut suscipit hendrerit, ipsum augue ornare nulla, non
luctus diam neque sit amet urna. Curabitur vulputate vestibulum lorem. Fusce
sagittis, libero non molestie mollis, magna orci ultrices dolor, at
vulputate neque nulla lacinia eros. Sed id ligula quis est convallis
tempor. Curabitur lacinia pulvinar nibh. Nam a sapien.
</p>
<p>
Pellentesque dapibus suscipit ligula. Donec posuere augue in quam. Etiam vel
tortor sodales tellus ultricies commodo. Suspendisse potenti. Aenean in sem
ac leo mollis blandit. Donec neque quam, dignissim in, mollis nec, sagittis
eu, wisi. Phasellus lacus. Etiam laoreet quam sed arcu. Phasellus at dui in
ligula mollis ultricies. Integer placerat tristique nisl. Praesent
augue. Fusce commodo. Vestibulum convallis, lorem a tempus semper, dui dui
euismod elit, vitae placerat urna tortor vitae lacus. Nullam libero mauris,
consequat quis, varius et, dictum id, arcu. Mauris mollis tincidunt
felis. Aliquam feugiat tellus ut neque. Nulla facilisis, risus a rhoncus
fermentum, tellus tellus lacinia purus, et dictum nunc justo sit amet elit.
</p>


</div>



<p class=\"verse\">
Great clouds overhead<br/>
Tiny black birds rise and fall<br/>
Snow covers Emacs<br/>
<br/>
&ndash; AlexSchroeder<br/>
</p>


<blockquote>

<p>Everything should be made as simple as possible,
but not any simpler &ndash; Albert Einstein
</p>
</blockquote>



<div style=\"text-align: center\">
<p>Everything should be made as simple as possible, <br/>
but not any simpler
</p>
</div>

</div>

</div>

<div id=\"outline-container-3\" class=\"outline-3\">
<h3 id=\"sec-3\">Lists</h3>
<div class=\"outline-text-3\" id=\"text-3\">


<p>
As taken from org manual:
</p>
<p>
My favorite scenes are (in this order)
</p><ol>
<li>The attack of the Rohirrim
</li>
<li>Eowyn's fight with the witch king
<ul>
<li>this was already my favorite scene in the book
</li>
<li>I really like Miranda Otto.
</li>
</ul>

</li>
<li>Peter Jackson being shot by Legolas
<ul>
<li>on DVD only
</li>
</ul>

<p>           He makes a really funny face when it happens.
</p></li>
</ol>

<p>But in the end, no individual scenes matter but the film as a whole.
Important actors in this film are:
</p><dl>
<dt>Elijah Wood</dt><dd>He plays Frodo
</dd>
<dt>Sean Austin</dt><dd>He plays Sam, Frodo's friend.  I still remember
          him very well from his role as Mikey Walsh in The Goonies.
</dd>
</dl>


</div>

</div>

<div id=\"outline-container-4\" class=\"outline-3\">
<h3 id=\"sec-4\">Footnotes</h3>
<div class=\"outline-text-3\" id=\"text-4\">


<p>
The Org homepage<sup><a class=\"footref\" name=\"fnr.1\" href=\"#fn.1\">1</a></sup> now looks a lot better than it used to.
</p>
</div>

</div>

<div id=\"outline-container-5\" class=\"outline-3\">
<h3 id=\"sec-5\">Emphasis and monospace</h3>
<div class=\"outline-text-3\" id=\"text-5\">


<p>
You can make words <b>bold</b>, <i>italic</i>, <span style=\"text-decoration:underline;\">underlined</span>, <code>code</code> and <code>verbatim</code>,
and, if you must, ‘+strike-through+’. Text in the code and verbatim string
is not processed for Org mode specific syntax; it is exported verbatim.
</p>
</div>

</div>

<div id=\"outline-container-6\" class=\"outline-3\">
<h3 id=\"sec-6\">Horizontal rules</h3>
<div class=\"outline-text-3\" id=\"text-6\">


<p>
A line consisting of only dashes, and at least 5 of them, will be exported
as a horizontal line (‘&lt;hr/&gt;’ in HTML and \\hrule in LaTeX).
</p>

<hr/>

<p>
As shown previously.
</p>
</div>

</div>

<div id=\"outline-container-7\" class=\"outline-3\">
<h3 id=\"sec-7\">Comment lines</h3>
<div class=\"outline-text-3\" id=\"text-7\">


<p>
Lines starting with ‘#’ in column zero are treated as comments and will
never be exported. If you want an indented line to be treated as a comment,
start it with ‘#+ ’. Also entire subtrees starting with the word ‘COMMENT’
will never be exported. Finally, regions surrounded by ‘#+BEGIN_COMMENT’
&hellip; ‘#+END_COMMENT’ will not be exported.
</p>


</div>

</div>

<div id=\"outline-container-8\" class=\"outline-3\">
<h3 id=\"sec-8\">Images and Tables</h3>
<div class=\"outline-text-3\" id=\"text-8\">


<p>
Table
</p>
<table  border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\" id=\"tbl-basic-data\">
<caption>This is the caption for the next table (or link)</caption>
<colgroup><col class=\"right\" /><col class=\"right\" /><col class=\"left\" /><col class=\"left\" /><col class=\"left\" />
</colgroup>
<thead>
<tr><th scope=\"col\" class=\"right\">Header 1</th><th scope=\"col\" class=\"right\">Header 2</th><th scope=\"col\" class=\"left\">Header 3</th><th scope=\"col\" class=\"left\">Header 4</th><th scope=\"col\" class=\"left\">Header 5</th></tr>
</thead>
<tbody>
<tr><td class=\"right\">1.1</td><td class=\"right\">1.2</td><td class=\"left\">1.3</td><td class=\"left\">X</td><td class=\"left\">This <i>cell</i> has a <b>very</b> <code>long</code> <code>line</code> <span style=\"text-decoration:underline;\">with</span>  <sub>special</sub> <sup>layouts</sup></td></tr>
<tr><td class=\"right\">2.1</td><td class=\"right\">2.2</td><td class=\"left\">3.3</td><td class=\"left\">Y</td><td class=\"left\"></td></tr>
</tbody>
<tbody>
<tr><td class=\"right\">3.1</td><td class=\"right\">3.1</td><td class=\"left\">C.1</td><td class=\"left\">D.1</td><td class=\"left\">E.1</td></tr>
</tbody>
</table>



<p>
Image
</p>
<p>
<a href=\"../../../tips/2012/01/07_syntax-org-mode/200px-Org-mode-unicorn.svg.png\"><img src=\"../../../tips/2012/01/07_syntax-org-mode/org-mode-unicorn.png\" alt=\"org-mode-unicorn.png\"/></a>
</p>
</div>

</div>

<div id=\"outline-container-9\" class=\"outline-3\">
<h3 id=\"sec-9\">Literal examples</h3>
<div class=\"outline-text-3\" id=\"text-9\">





<pre class=\"example\">Some example from a text file.
</pre>



<p>
Here is an example
</p><pre class=\"example\">
Some example from a text file.
</pre>





<pre class=\"src src-emacs-lisp\">(<span style=\"color: #00ffff;\">defun</span> <span style=\"color: #87cefa;\">org-xor</span> (a b)
  <span style=\"color: #ffa07a;\">\"Exclusive or.\"</span>
  (<span style=\"color: #00ffff;\">if</span> a (not b) b))
</pre>



<pre class=\"src src-emacs-lisp\"><span id=\"coderef-sc\" class=\"coderef-off\"><span class=\"linenr\">1:  </span>(<span style=\"color: #00ffff;\">save-excursion</span></span>
<span id=\"coderef-jump\" class=\"coderef-off\"><span class=\"linenr\">2:  </span>   (goto-char (point-min)))</span>
</pre>


<p>
In line <a href=\"#coderef-sc\" class=\"coderef\" onmouseover=\"CodeHighlightOn(this, 'coderef-sc');\" onmouseout=\"CodeHighlightOff(this, 'coderef-sc');\">1</a> we remember the current position.  <a href=\"#coderef-jump\" class=\"coderef\" onmouseover=\"CodeHighlightOn(this, 'coderef-jump');\" onmouseout=\"CodeHighlightOff(this, 'coderef-jump');\">Line 2</a>
jumps to point-min.
</p>
</div>

</div>

<div id=\"outline-container-10\" class=\"outline-3\">
<h3 id=\"sec-10\">Special symbols</h3>
<div class=\"outline-text-3\" id=\"text-10\">


<p>
Angles are written as Greek letters &alpha;, &beta; and &gamma;.
</p>
</div>

</div>

<div id=\"outline-container-11\" class=\"outline-3\">
<h3 id=\"sec-11\">Subscripts and superscripts</h3>
<div class=\"outline-text-3\" id=\"text-11\">


<p>
The mass of the sun is M<sub>sun</sub> = 1.989 x 10<sup>30</sup> kg.  The radius of
the sun is R<sub>sun</sub> = 6.96 x 10<sup>8</sup> m.
</p>
</div>

</div>

<div id=\"outline-container-12\" class=\"outline-3\">
<h3 id=\"sec-12\">links</h3>
<div class=\"outline-text-3\" id=\"text-12\">


<ul>
<li>outsite (page): <a href=\"https://github.com/renard/o-blog\"><i>o-blog</i> home</a>.
</li>
<li><a href=\"#Creating-a-blog\">Creating a blog</a>
</li>
<li>insite (file): <a href=\"o-blog.el\">o-blog.el</a>
</li>
<li>in page (anchor): <a href=\"#sec-9\">Literal examples</a>
</li>
</ul>


<div id=\"footnotes\">
<h2 class=\"footnotes\">Footnotes: </h2>
<div id=\"text-footnotes\">
<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.1\" href=\"#fnr.1\">1</a></sup> The link is: <a href=\"http://orgmode.org\">http://orgmode.org</a>
</p></div>
</div>

</div>
</div>
"

如何使用标签

导出博文信息 如何使用标签
属性
id
11
title
"如何使用标签"
timespamp
(20231 8464)
year
2012
month
1
day
7
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "o-blog" "o-blog" nil nil])
template
"blog_post.html"
filepath
"tips/2012/01"
filename
"use-tags"
htmlfile
"tips/2012/01/07_use-tags.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


Tags are useful to classify articles. They are stored as [[http://orgmode.org/manual/Tags.html][org-mode tags]] for
each entries. To add or modify a tag for a post, just use =C-c C-c= and
enter the tag value.

If an article has more than one tag, separate them by a colon (=:=).

Special characters used in tags:

  - At sign (=@=) is converted to a dash (=-=).
  - Underscore (=_=) is converted to a blank (= =).
"
content-html
"<p>
Tags are useful to classify articles. They are stored as <a href=\"http://orgmode.org/manual/Tags.html\">org-mode tags</a> for
each entries. To add or modify a tag for a post, just use <code>C-c C-c</code> and
enter the tag value.
</p>
<p>
If an article has more than one tag, separate them by a colon (<code>:</code>).
</p>
<p>
Special characters used in tags:
</p>
<ul>
<li>At sign (<code>@</code>) is converted to a dash (<code>-</code>).
</li>
<li>Underscore (<code>_</code>) is converted to a blank (<code> </code>).
</li>
</ul>

"

创建一个博客条目

导出博文信息 创建一个博客条目
属性
id
12
title
"创建一个博客条目"
timespamp
(20231 7564)
year
2012
month
1
day
7
category
[cl-struct-ob:category "Tips" "tips"]
tags
([cl-struct-ob:tags "用例" "a0b1dd52a1c893aa52b103dad9aa9d59" nil nil] [cl-struct-ob:tags "o-blog" "o-blog" nil nil])
template
"blog_post.html"
filepath
"tips/2012/01"
filename
"create-new-post"
htmlfile
"tips/2012/01/07_create-new-post.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


A blog consists of org entries. Each entry has a title, some properties and
some text. Exporting a blog means publishing all entries with a =DONE=
=TODO=.

A minimal blog file could be something like:

#+begin_src org

  ,#+TITLE: Lorem ipsum
  ,#+DESCRIPTION: dolor sit amet
  ,#+DATE:

  ,#+STARTUP: logdone

  ,#+URL: http://blog.example.com

  ,* DONE Lorem ipsum
  ,  CLOSED: [2012-01-07 Sat 00:13]
  ,  :PROPERTIES:
  ,  :tags:     Lorem
  ,  :END:

  ,  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
  ,  tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt
  ,  et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et
  ,  magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec
  ,  vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan
  ,  nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

#+end_src

Please note the blank line between the properties section and the text itself.

Use =#+STARTUP: logdone= to automatically add a time stamp when closing an
entry.
"
content-html
"<p>
A blog consists of org entries. Each entry has a title, some properties and
some text. Exporting a blog means publishing all entries with a <code>DONE</code>
<code>TODO</code>.
</p>
<p>
A minimal blog file could be something like:
</p>



<pre class=\"src src-org\"><span style=\"color: #7f7f7f;\">#+TITLE:</span><span style=\"color: #ff4500;\"> </span><span style=\"color: #191970; font-size: 144%;\">Lorem ipsum</span>
<span style=\"color: #ff4500;\">#+DESCRIPTION: dolor sit amet</span>
<span style=\"color: #7f7f7f;\">#+DATE:</span>

<span style=\"color: #ff4500;\">#+STARTUP: logdone</span>

<span style=\"color: #ff4500;\">#+URL: http://blog.example.com</span>

<span style=\"color: #87cefa;\">* </span><span style=\"color: #228b22;\">DONE</span><span style=\"color: #87cefa;\"> Lorem ipsum</span>
  <span style=\"color: #00ffff;\">CLOSED:</span> <span style=\"color: #a020f0;\">[2012-01-07 Sat 00:13]</span>
<span style=\"color: #00ffff;\">  :PROPERTIES:</span>
  <span style=\"color: #00ffff;\">:tags:</span>     Lorem
<span style=\"color: #00ffff;\">  :END:</span>

  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit
  tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt
  et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et
  magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec
  vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan
  nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

</pre>


<p>
Please note the blank line between the properties section and the text itself.
</p>
<p>
Use <code>#+STARTUP: logdone</code> to automatically add a time stamp when closing an
entry.
</p>"

固定页面

快速入门指南

导出博文信息 快速入门指南
属性
id
0
title
"快速入门指南"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "Tips" "tips"]
tags
nil
template
"blog_static_no_title.html"
filepath
nil
filename
"index"
htmlfile
"index.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


#+BEGIN_HTML
<div class=\"row \"><div class=\"span8 \">
#+END_HTML


#+BEGIN_HTML
<div class=\"hero-unit\">

#+END_HTML

#+HTML: <h1>o-blog</h1>

使用 [[http://orgmode.org/][org-mode]] 的独立博客系统。

#+BEGIN_HTML
</div>

#+END_HTML


#+HTML: <h1 style=\"font-size: 500%;\">Quick start guide</h1>

#+BEGIN_HTML
</div><div class=\"span4 \">
#+END_HTML



#+HTML: <div class=\"hero-unit\" style=\"font-size: 200%;\">

[[file:./features.html][/icon-cog icon-white/ 特性]]

[[https://github.com/renard/o-blog][/icon-github-sign icon-white/ GitHub]]

[[file:./testimonials.html][/icon-comments-alt icon-white/ 用户推荐]]

[[file:./changelog.html][/icon-pencil icon-white/ 更新记录]]

[[file:./bug-report.html][/icon-fire icon-white/ Bug report]]


#+HTML: </div>


#+BEGIN_HTML
</div></div>
#+END_HTML



** 设置

首先,你需要安装有 [[http://www.gnu.org/s/emacs][emacs]] (在版本 24 下测试,在 23 下可能也行) 和 [[http://orgmode.org/][org-mode]] (在版本
7.8.09 下测试,其它的 /可能/ 也行)。然后你有两种方法可以安装 [[https://github.com/renard/o-blog][o-blog]].

#+BEGIN_HTML
<div class=\"row \"><div class=\"span5 \">
#+END_HTML


#+HTML: <h4>使用 el-get</h4>

要使用 [[https://github.com/dimitri/el-get][el-get]], 安装起来很容易。你所要做的不过是将 =o-blog= 添加到
=el-get-sources= 中,然后执行:

 =M-x el-get-install o-blog=

如果你使用 =el-get= 4 或更高,你只需要执行:

=M-x el-get-install o-blog=

#+BEGIN_HTML
</div><div class=\"span6 \">
#+END_HTML


#+html: <h4>手动安装</h4>

首先从 [[http://github.com][Github]] 克隆 /git/ 仓库源码。

#+begin_src bash
cd ~/.emacs.d
git clone https://github.com/renard/o-blog.git
#+end_src

将如下内容添加到你的 =~/.emacs.d/init.el= 文件中:

#+begin_src emacs-lisp
  (add-to-list 'load-path \"~/.emacs.d/o-blog\")
  (require 'o-blog)
#+end_src


#+BEGIN_HTML
</div></div>
#+END_HTML



** 发布博文

打开文件 =~/.emacs.d/o-blog/example/sample.org= 然后执行 =M-x
org-publish-blog=. 输出的站点默认保存在 =~/.emacs.d/o-blog/out=.

详情参见 [[file:tips/index.html][tips]].
"
content-html
"<div class=\"row \"><div class=\"span8 \">


<div class=\"hero-unit\">




<h1>o-blog</h1>

<p>
使用 <a href=\"http://orgmode.org/\">org-mode</a> 的独立博客系统。
</p>


</div>





<h1 style=\"font-size: 500%;\">Quick start guide</h1>

</div><div class=\"span4 \">



<div class=\"hero-unit\" style=\"font-size: 200%;\">

<p>
<a href=\"./features.html\"><i>icon-cog icon-white</i> 特性</a>
</p>
<p>
<a href=\"https://github.com/renard/o-blog\"><i>icon-github-sign icon-white</i> GitHub</a>
</p>
<p>
<a href=\"./testimonials.html\"><i>icon-comments-alt icon-white</i> 用户推荐</a>
</p>
<p>
<a href=\"./changelog.html\"><i>icon-pencil icon-white</i> 更新记录</a>
</p>
<p>
<a href=\"./bug-report.html\"><i>icon-fire icon-white</i> Bug report</a>
</p>



</div>


</div></div>




<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">设置</h3>
<div class=\"outline-text-3\" id=\"text-1\">


<p>
首先,你需要安装有 <a href=\"http://www.gnu.org/s/emacs\">emacs</a> (在版本 24 下测试,在 23 下可能也行) 和 <a href=\"http://orgmode.org/\">org-mode</a> (在版本
7.8.09 下测试,其它的 <i>可能</i> 也行)。然后你有两种方法可以安装 <a href=\"https://github.com/renard/o-blog\">o-blog</a>.
</p>


<div class=\"row \"><div class=\"span5 \">




<h4>使用 el-get</h4>

<p>
要使用 <a href=\"https://github.com/dimitri/el-get\">el-get</a>, 安装起来很容易。你所要做的不过是将 <code>o-blog</code> 添加到
<code>el-get-sources</code> 中,然后执行:
</p>
<p>
 <code>M-x el-get-install o-blog</code>
</p>
<p>
如果你使用 <code>el-get</code> 4 或更高,你只需要执行:
</p>
<p>
<code>M-x el-get-install o-blog</code>
</p>


</div><div class=\"span6 \">




<h4>手动安装</h4>

<p>
首先从 <a href=\"http://github.com\">Github</a> 克隆 <i>git</i> 仓库源码。
</p>



<pre class=\"src src-bash\">cd ~/.emacs.d
git clone https://github.com/renard/o-blog.git
</pre>


<p>
将如下内容添加到你的 <code>~/.emacs.d/init.el</code> 文件中:
</p>



<pre class=\"src src-emacs-lisp\">(add-to-list 'load-path <span style=\"color: #ffa07a;\">\"~/.emacs.d/o-blog\"</span>)
(<span style=\"color: #00ffff;\">require</span> '<span style=\"color: #7fffd4;\">o-blog</span>)
</pre>



</div></div>



</div>

</div>

<div id=\"outline-container-2\" class=\"outline-3\">
<h3 id=\"sec-2\">发布博文</h3>
<div class=\"outline-text-3\" id=\"text-2\">


<p>
打开文件 <code>~/.emacs.d/o-blog/example/sample.org</code> 然后执行 <code>M-x org-publish-blog</code>. 输出的站点默认保存在 <code>~/.emacs.d/o-blog/out</code>.
</p>
<p>
详情参见 <a href=\"tips/index.html\">tips</a>.
</p></div>
</div>
"

Articles by tags

导出博文信息 Articles by tags
属性
id
1
title
"Articles by tags"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "博客设置" "788f2c7b101e31eb2a10d94e633dc717"]
tags
nil
template
"blog_post-by-tags.html"
filepath
nil
filename
"tags"
htmlfile
"tags.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil

"
content-html
"
"

更新记录

导出博文信息 更新记录
属性
id
2
title
"更新记录"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "Tips" "tips"]
tags
nil
template
"blog_static.html"
filepath
nil
filename
"changelog"
htmlfile
"changelog.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


- 2012-06-21
  - 添加发布排序选项。

- 2012-06-05
  - 更新模版
    - Font-Awesome 2.0.0-6-g35fca03
    - bootstrap 2.0.4

- 2012-05-21
  - 使用应答式 bootstrap 功能。

- 2012-05-07
  - 更新模版:
    - less.js v1.0-547-ga2df119
  - Bootstrap 插件:
    - label
    - badge
    - progress bar
    - well
    - page header
    - hero unit

- 2012-05-04
  - 更新风格模版:
    - bootstrap v2.0.3-5-gb261f97.

- 2012-04-17
  - 更新风格模版:
    - less 1.3.0.
    - Font-Awesome v1.0.0-7-g563a6f3.
    - bootstrap v2.0.2-3-g6506ede.

- 2012-04-10
  - 添加多国语言 (i18n) 支持。

- 2012-04-06
  - 添加 org-mode 的 CUSTOM\\_ID 支持。

- 2012-03-28
  - 添加 [[http://en.wikipedia.org/wiki/QR_code][QR-code]] 二维标识码支持。

- 2012-03-21
  - 合并上述代码,更新中文演示模版,修改 snippet 为中文。
  - 添加 Disqus 中文讨论。

- 2012-03-20
  - Add [[http://disqus.com][Disqus]] support.
  - User can select the file name sanitizer function.
  - Add [[file:./bug-report.html][bug report howto]].

- 2012-03-19
  - 使用 MD5SUM 作为 tags-safe 及 post filename, 解决中文名称的问题 (exaos)

- 2012-03-06
  - 支持 Font-Awesome

- 2012-02-28
  - 切换到 bootstrap 2.0.1
  - 切换到 lesscss 1.2.2

- 2012-01-23
  - 切换标签系统由 \"Tags\" 到 org 标签系统。
"
content-html
"<ul>
<li>2012-06-21
<ul>
<li>添加发布排序选项。

</li>
</ul>

</li>
<li>2012-06-05
<ul>
<li>更新模版
<ul>
<li>Font-Awesome 2.0.0-6-g35fca03
</li>
<li>bootstrap 2.0.4

</li>
</ul>

</li>
</ul>

</li>
<li>2012-05-21
<ul>
<li>使用应答式 bootstrap 功能。

</li>
</ul>

</li>
<li>2012-05-07
<ul>
<li>更新模版:
<ul>
<li>less.js v1.0-547-ga2df119
</li>
</ul>

</li>
<li>Bootstrap 插件:
<ul>
<li>label
</li>
<li>badge
</li>
<li>progress bar
</li>
<li>well
</li>
<li>page header
</li>
<li>hero unit

</li>
</ul>

</li>
</ul>

</li>
<li>2012-05-04
<ul>
<li>更新风格模版:
<ul>
<li>bootstrap v2.0.3-5-gb261f97.

</li>
</ul>

</li>
</ul>

</li>
<li>2012-04-17
<ul>
<li>更新风格模版:
<ul>
<li>less 1.3.0.
</li>
<li>Font-Awesome v1.0.0-7-g563a6f3.
</li>
<li>bootstrap v2.0.2-3-g6506ede.

</li>
</ul>

</li>
</ul>

</li>
<li>2012-04-10
<ul>
<li>添加多国语言 (i18n) 支持。

</li>
</ul>

</li>
<li>2012-04-06
<ul>
<li>添加 org-mode 的 CUSTOM_ID 支持。

</li>
</ul>

</li>
<li>2012-03-28
<ul>
<li>添加 <a href=\"http://en.wikipedia.org/wiki/QR_code\">QR-code</a> 二维标识码支持。

</li>
</ul>

</li>
<li>2012-03-21
<ul>
<li>合并上述代码,更新中文演示模版,修改 snippet 为中文。
</li>
<li>添加 Disqus 中文讨论。

</li>
</ul>

</li>
<li>2012-03-20
<ul>
<li>Add <a href=\"http://disqus.com\">Disqus</a> support.
</li>
<li>User can select the file name sanitizer function.
</li>
<li>Add <a href=\"./bug-report.html\">bug report howto</a>.

</li>
</ul>

</li>
<li>2012-03-19
<ul>
<li>使用 MD5SUM 作为 tags-safe 及 post filename, 解决中文名称的问题 (exaos)

</li>
</ul>

</li>
<li>2012-03-06
<ul>
<li>支持 Font-Awesome

</li>
</ul>

</li>
<li>2012-02-28
<ul>
<li>切换到 bootstrap 2.0.1
</li>
<li>切换到 lesscss 1.2.2

</li>
</ul>

</li>
<li>2012-01-23
<ul>
<li>切换标签系统由 \"Tags\" 到 org 标签系统。
</li>
</ul>

</li>
</ul>

"

调试

导出博文信息 调试
属性
id
3
title
"调试"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"debug.html"
filepath
nil
filename
"debug"
htmlfile
"debug.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil

"
content-html
"
"

特性

导出博文信息 特性
属性
id
4
title
"特性"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"blog_static.html"
filepath
nil
filename
"features"
htmlfile
"features.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


- 外观
  - 带[[file:./debug.html][调试功能]]的动态模版系统 (使用 lisp 函数), 方便嵌入 [[file:./bug-report.html][错误报告工具]]
  - 输出的代码片断带有语法加亮
  - 支持 [[http://twitter.github.com/bootstrap/][bootstrap]]
  - 支持 [[http://fortaweso.me/font-awesome/][Font-Awesome]]
  - 支持 [[http://lesscss.org/][lesscss]]
  - 支持 [[http://jquery.com/][JQuery]]
  - 支持 HTML5 / CSS3
- 博客
  - 静态页面 
  - [[file:./tags/index.html][云标签]]
  - 多个博客
  - [[file:./archives.html][博文归档]]
  - 支持 [[http://disqus.com][Disqus]]
  - 支持 [[http://en.wikipedia.org/wiki/QR_code][QR code]]
- 博文发布
  - 同时支持同步与异步发布
  - 直接发布到网站服务器上 (通过 tramp)
- [[http://twitter.github.com/bootstrap/][Bootstrap]] 额外功能
  - 警告框
  - 支持图标 ([[http://glyphicons.com/][glyphicons]])
"
content-html
"<ul>
<li>外观
<ul>
<li>带<a href=\"./debug.html\">调试功能</a>的动态模版系统 (使用 lisp 函数), 方便嵌入 <a href=\"./bug-report.html\">错误报告工具</a>
</li>
<li>输出的代码片断带有语法加亮
</li>
<li>支持 <a href=\"http://twitter.github.com/bootstrap/\">bootstrap</a>
</li>
<li>支持 <a href=\"http://fortaweso.me/font-awesome/\">Font-Awesome</a>
</li>
<li>支持 <a href=\"http://lesscss.org/\">lesscss</a>
</li>
<li>支持 <a href=\"http://jquery.com/\">JQuery</a>
</li>
<li>支持 HTML5 / CSS3
</li>
</ul>

</li>
<li>博客
<ul>
<li>静态页面 
</li>
<li><a href=\"./tags/index.html\">云标签</a>
</li>
<li>多个博客
</li>
<li><a href=\"./archives.html\">博文归档</a>
</li>
<li>支持 <a href=\"http://disqus.com\">Disqus</a>
</li>
<li>支持 <a href=\"http://en.wikipedia.org/wiki/QR_code\">QR code</a>
</li>
</ul>

</li>
<li>博文发布
<ul>
<li>同时支持同步与异步发布
</li>
<li>直接发布到网站服务器上 (通过 tramp)
</li>
</ul>

</li>
<li><a href=\"http://twitter.github.com/bootstrap/\">Bootstrap</a> 额外功能
<ul>
<li>警告框
</li>
<li>支持图标 (<a href=\"http://glyphicons.com/\">glyphicons</a>)
</li>
</ul>

</li>
</ul>

"

模版

导出博文信息 模版
属性
id
5
title
"模版"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"blog_static.html"
filepath
nil
filename
"templates"
htmlfile
"templates.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


在 [[https://github.com/renard/o-blog][o-blog]] 导出过程中占重头戏的是模版,一组 HTML 的文件。可解析的 Lisp 源码以
=<lisp>= 标签嵌入其中。

#+begin_src html
<h1><lisp>(ob:blog-title BLOG)</lisp></h1>
#+end_src

上面的代码片断可导出为如下类似的内容:

#+begin_src html
<h1>o-blog</h1>
#+end_src

#+BEGIN_HTML
<div class=\"alert alert-info\"><p class=\"alert-heading\">Information</p>
#+END_HTML

如果不需要其它模版, [[https://github.com/renard/o-blog][o-blog]] 只用以 =blog_= 打头的模版文件就够了(通过函数
=ob:insert-template= )。

所有其它的模版只是为了方便而定义。

#+BEGIN_HTML
</div>
#+END_HTML



** 必要的模版

=blog_= 打头的模版。

 - =blog_static.html=: 导出任何静态页面 (函数 =ob-write-static=).
 - =blog_post.html=: 导出一篇博文 (函数 =ob-write-posts=).
 - =blog_tags.html=: 导出云标签页面 (函数 =ob-write-tags=).
 - =blog_tags-detail.html=: 导出匹配特定标签的页面 (函数 =ob-write-tags=).
 - =blog_archive.html=: 导出全部归档 (所有类别、所有年、所有月) 页面 (函数 =ob-write-index=).
 - =blog_rss.html=: 导出 RSS 订阅 (函数 =ob-write-index=).
 - =blog_index_month.html= 导出指定月的索引页面 (函数 =ob-write-index=).
 - =blog_index_year.html= 导出指定月的索引页面 (函数 =ob-write-index=).
 - =blog_index_catery.html= 导出指定类别的索引页面 (函数 =ob-write-index=).

** 索引模版

以 =index_= 打头的模版。它们使用所有的 =blog_index_*.html= 模版来生成一组匹配指定类别、年、月和全部归档的文章列表。

 - =index_archives.html=
 - =index_category.html=
 - =index_month.html=
 - =index_year.html=

** 导航模版

以 =nav_= 开头的模版用于生成导航片断:

 - =nav_links.html=: 用于生成用于页首和页尾的的导航菜单。
 - =nav_tag-cloud.html=: 用于生成页尾的云标签。

** 页面模版

以 =page_= 开头的模版用于生成 HTML 的页头及页尾。

"
content-html
"<p>
在 <a href=\"https://github.com/renard/o-blog\">o-blog</a> 导出过程中占重头戏的是模版,一组 HTML 的文件。可解析的 Lisp 源码以
<code>&lt;lisp&gt;</code> 标签嵌入其中。
</p>



<pre class=\"src src-html\">&lt;<span style=\"color: #87cefa;\">h1</span>&gt;&lt;<span style=\"color: #87cefa;\">lisp</span>&gt;(ob:blog-title BLOG)&lt;/<span style=\"color: #87cefa;\">lisp</span>&gt;&lt;/<span style=\"color: #87cefa;\">h1</span>&gt;
</pre>


<p>
上面的代码片断可导出为如下类似的内容:
</p>



<pre class=\"src src-html\">&lt;<span style=\"color: #87cefa;\">h1</span>&gt;<span style=\"font-weight: bold; text-decoration: underline;\">o-blog</span>&lt;/<span style=\"color: #87cefa;\">h1</span>&gt;
</pre>


<div class=\"alert alert-info\"><p class=\"alert-heading\">Information</p>

<p>
如果不需要其它模版, <a href=\"https://github.com/renard/o-blog\">o-blog</a> 只用以 <code>blog_</code> 打头的模版文件就够了(通过函数
<code>ob:insert-template</code> )。
</p>
<p>
所有其它的模版只是为了方便而定义。
</p>


</div>




<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">必要的模版</h3>
<div class=\"outline-text-3\" id=\"text-1\">


<p>
<code>blog_</code> 打头的模版。
</p>
<ul>
<li><code>blog_static.html</code>: 导出任何静态页面 (函数 <code>ob-write-static</code>).
</li>
<li><code>blog_post.html</code>: 导出一篇博文 (函数 <code>ob-write-posts</code>).
</li>
<li><code>blog_tags.html</code>: 导出云标签页面 (函数 <code>ob-write-tags</code>).
</li>
<li><code>blog_tags-detail.html</code>: 导出匹配特定标签的页面 (函数 <code>ob-write-tags</code>).
</li>
<li><code>blog_archive.html</code>: 导出全部归档 (所有类别、所有年、所有月) 页面 (函数 <code>ob-write-index</code>).
</li>
<li><code>blog_rss.html</code>: 导出 RSS 订阅 (函数 <code>ob-write-index</code>).
</li>
<li><code>blog_index_month.html</code> 导出指定月的索引页面 (函数 <code>ob-write-index</code>).
</li>
<li><code>blog_index_year.html</code> 导出指定月的索引页面 (函数 <code>ob-write-index</code>).
</li>
<li><code>blog_index_catery.html</code> 导出指定类别的索引页面 (函数 <code>ob-write-index</code>).
</li>
</ul>


</div>

</div>

<div id=\"outline-container-2\" class=\"outline-3\">
<h3 id=\"sec-2\">索引模版</h3>
<div class=\"outline-text-3\" id=\"text-2\">


<p>
以 <code>index_</code> 打头的模版。它们使用所有的 <code>blog_index_*.html</code> 模版来生成一组匹配指定类别、年、月和全部归档的文章列表。
</p>
<ul>
<li><code>index_archives.html</code>
</li>
<li><code>index_category.html</code>
</li>
<li><code>index_month.html</code>
</li>
<li><code>index_year.html</code>
</li>
</ul>


</div>

</div>

<div id=\"outline-container-3\" class=\"outline-3\">
<h3 id=\"sec-3\">导航模版</h3>
<div class=\"outline-text-3\" id=\"text-3\">


<p>
以 <code>nav_</code> 开头的模版用于生成导航片断:
</p>
<ul>
<li><code>nav_links.html</code>: 用于生成用于页首和页尾的的导航菜单。
</li>
<li><code>nav_tag-cloud.html</code>: 用于生成页尾的云标签。
</li>
</ul>


</div>

</div>

<div id=\"outline-container-4\" class=\"outline-3\">
<h3 id=\"sec-4\">页面模版</h3>
<div class=\"outline-text-3\" id=\"text-4\">


<p>
以 <code>page_</code> 开头的模版用于生成 HTML 的页头及页尾。
</p>
</div>
</div>
"

结构

导出博文信息 结构
属性
id
6
title
"结构"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"blog_static.html"
filepath
nil
filename
"structures"
htmlfile
"structures.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


Some variables are available when publishing lisp parts of templates. These
variables are defined using [[http://www.gnu.org/software/emacs/manual/html_node/cl/Structures.html][defstruct]], then any slot (or property) is
available using a =(type-slot variable)= form.

** 文档结构

*** Structures: =ob:blog=

Structure used to define a blog:

 - =file=: the blog source file (read-only).
 - =buffer=: buffer visiting the blog file (read-only).
 - =publish-dir=: where to publish the blog defined by the =#+PUBLISH_DIR:=
   header directive or =out= in the same directory as the blog source file.
 - =template-dir=: location of the template directory defined by the
   =#+TEMPLATE_DIR:= header directive or the =templates= directory of the
   =o-blog= library.
 - =style-dir=: path of the /css/ files defined by the =#STYLE_DIR:= header
   directive or =style=. This directory is relative to =template-dir=.
 - =posts-filter=: default filter for post defined by the =#POSTS_FILTER:=
   header directive or =+TODO={DONE}=.
 - =static-filter=: default filter for static pages defined by the
   =#STATIC_FILTER:= header directive or =+PAGES={.*}=.
 - =snippet-filter=  default filter for snippets defined by the
   =#SNIPPET_FILTER:= header directive or =+SNIPPET={.*}=.
 - =title=: Blog title defined by the =#+TITLE:= header directive.
 - =description=: blog description defined by the =#+DESCRIPTION:= header
   directive.
 - =url=: Blog base URL defined by the =#+URL:= header.
 - =default-category=: default category for posts  defined by the
   =#DEFAULT_CATEGORY:= header or =Blog=.
 - =disqus=: [[http://docs.disqus.com/developers/universal/][disqus]] account (called a forum on [[http://disqus.com][Disqus]]) this system
   belongs to. Defined by the \\\"#DISQUS\\\" header.
 - =filename-sanitizer=: 1-argument function to be used to sanitize
   post filenames. Defined by =#+FILENAME_SANITIZER:= or
   =ob-sanitize-string=.

Example:

#+begin_src emacs-lisp
;; get the title of the current blog defined in variable BLOG.
(ob:blog-title BLOG)
#+end_src

*** Structures: =ob:post=

 - =id=: the post numerical id. Posts are sort by reversed chronological
   order. The most recent post get the id 0.
 - =title=: the post title read from the entry title.
 - =timestamp=: the post timestamp given by the =CLOSED= property or the
   current time.
 - =year=: numerical year computed from =timestamp=.
 - =month=: numerical month computed from =timestamp=.
 - =day=: numerical day computed from =timestamp=.
 - =category=: category read from =CATEGORY= property org =blog=.
 - =tags=: list of =ob:tags=.
 - =template=: template to use for current post read from =TEMPLATE=
   property or =blog_post.html=.
 - =filepath=: relative path from the blog root directory to the post
   directory (directory only).
 - =filename=: sanitized filename generated from =title=.
 - =htmlfile=: full relative path to the post html file (file and
   directory).
 - =path-to-root=: relative path from the post html file to the blog root.
 - =content=: raw content of the post (org-mode format).
 - =content-html=: HTML export of the post.

Example:

#+begin_src emacs-lisp
;; get the HTML content of the post defined in variable POST.
(ob:post-content-html POST)
#+end_src

*** Structures: =ob:tags=

Structure used to define a tag:

 - =name=: string defying the tag name.
 - =safe=: web safe tag name for URL.
 - =count=: how many time the tag is used.
 - =size=: the font size in percent.

Example:

#+begin_src emacs-lisp
;; get the name of the tag defined in variable TAG.
(ob:tags-name TAG)
#+end_src

** 变量

Following variables are always available when publishing a blog:

 - =BLOG= (=ob:blog=): information about the blog being published.
 - =POSTS= (list of =ob:post=): list of all posts of the blog or restricted
   list of posts (depending what is exported).
 - =ALL-POSTS=: A copy of =POSTS= except this *always* contents all the
   posts from the blog.
 - =STATIC= (list of =ob:post=): list of static pages.
 - =SNIPPETS= (list of =ob:post=): list of snippets pages.
 - =TAGS= (list of =ob:tags=): list of all tags.

Some variables may be defined in some functions:

 - =POST= (=ob:post=): post (or static page) being currently published.
 - =TAG= (=ob:tags=): tag being currently published.
 - =CATEGORY= (=string=): the category being published.
 - =YEAR=, =MONTH (=integer=): the year and month being published.
 - =PATH-TO-ROOT= (=string=): (intern use only, use =ob:path-to-root=
   instead) path to blog root used by =ob:path-to-root=.
"
content-html
"<p>
Some variables are available when publishing lisp parts of templates. These
variables are defined using <a href=\"http://www.gnu.org/software/emacs/manual/html_node/cl/Structures.html\">defstruct</a>, then any slot (or property) is
available using a <code>(type-slot variable)</code> form.
</p>

<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">文档结构</h3>
<div class=\"outline-text-3\" id=\"text-1\">



</div>

<div id=\"outline-container-1-1\" class=\"outline-4\">
<h4 id=\"sec-1-1\">Structures: <code>ob:blog</code></h4>
<div class=\"outline-text-4\" id=\"text-1-1\">


<p>
Structure used to define a blog:
</p>
<ul>
<li><code>file</code>: the blog source file (read-only).
</li>
<li><code>buffer</code>: buffer visiting the blog file (read-only).
</li>
<li><code>publish-dir</code>: where to publish the blog defined by the <code>#+PUBLISH_DIR:</code>
   header directive or <code>out</code> in the same directory as the blog source file.
</li>
<li><code>template-dir</code>: location of the template directory defined by the
   <code>#+TEMPLATE_DIR:</code> header directive or the <code>templates</code> directory of the
   <code>o-blog</code> library.
</li>
<li><code>style-dir</code>: path of the <i>css</i> files defined by the <code>#STYLE_DIR:</code> header
   directive or <code>style</code>. This directory is relative to <code>template-dir</code>.
</li>
<li><code>posts-filter</code>: default filter for post defined by the <code>#POSTS_FILTER:</code>
   header directive or <code>+TODO={DONE}</code>.
</li>
<li><code>static-filter</code>: default filter for static pages defined by the
   <code>#STATIC_FILTER:</code> header directive or <code>+PAGES={.*}</code>.
</li>
<li><code>snippet-filter</code>  default filter for snippets defined by the
   <code>#SNIPPET_FILTER:</code> header directive or <code>+SNIPPET={.*}</code>.
</li>
<li><code>title</code>: Blog title defined by the <code>#+TITLE:</code> header directive.
</li>
<li><code>description</code>: blog description defined by the <code>#+DESCRIPTION:</code> header
   directive.
</li>
<li><code>url</code>: Blog base URL defined by the <code>#+URL:</code> header.
</li>
<li><code>default-category</code>: default category for posts  defined by the
   <code>#DEFAULT_CATEGORY:</code> header or <code>Blog</code>.
</li>
<li><code>disqus</code>: <a href=\"http://docs.disqus.com/developers/universal/\">disqus</a> account (called a forum on <a href=\"http://disqus.com\">Disqus</a>) this system
   belongs to. Defined by the \\\"#DISQUS\\\" header.
</li>
<li><code>filename-sanitizer</code>: 1-argument function to be used to sanitize
   post filenames. Defined by <code>#+FILENAME_SANITIZER:</code> or
   <code>ob-sanitize-string</code>.
</li>
</ul>


<p>
Example:
</p>



<pre class=\"src src-emacs-lisp\"><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">get the title of the current blog defined in variable BLOG.</span>
(ob:blog-title BLOG)
</pre>


</div>

</div>

<div id=\"outline-container-1-2\" class=\"outline-4\">
<h4 id=\"sec-1-2\">Structures: <code>ob:post</code></h4>
<div class=\"outline-text-4\" id=\"text-1-2\">


<ul>
<li><code>id</code>: the post numerical id. Posts are sort by reversed chronological
   order. The most recent post get the id 0.
</li>
<li><code>title</code>: the post title read from the entry title.
</li>
<li><code>timestamp</code>: the post timestamp given by the <code>CLOSED</code> property or the
   current time.
</li>
<li><code>year</code>: numerical year computed from <code>timestamp</code>.
</li>
<li><code>month</code>: numerical month computed from <code>timestamp</code>.
</li>
<li><code>day</code>: numerical day computed from <code>timestamp</code>.
</li>
<li><code>category</code>: category read from <code>CATEGORY</code> property org <code>blog</code>.
</li>
<li><code>tags</code>: list of <code>ob:tags</code>.
</li>
<li><code>template</code>: template to use for current post read from <code>TEMPLATE</code>
   property or <code>blog_post.html</code>.
</li>
<li><code>filepath</code>: relative path from the blog root directory to the post
   directory (directory only).
</li>
<li><code>filename</code>: sanitized filename generated from <code>title</code>.
</li>
<li><code>htmlfile</code>: full relative path to the post html file (file and
   directory).
</li>
<li><code>path-to-root</code>: relative path from the post html file to the blog root.
</li>
<li><code>content</code>: raw content of the post (org-mode format).
</li>
<li><code>content-html</code>: HTML export of the post.
</li>
</ul>


<p>
Example:
</p>



<pre class=\"src src-emacs-lisp\"><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">get the HTML content of the post defined in variable POST.</span>
(ob:post-content-html POST)
</pre>


</div>

</div>

<div id=\"outline-container-1-3\" class=\"outline-4\">
<h4 id=\"sec-1-3\">Structures: <code>ob:tags</code></h4>
<div class=\"outline-text-4\" id=\"text-1-3\">


<p>
Structure used to define a tag:
</p>
<ul>
<li><code>name</code>: string defying the tag name.
</li>
<li><code>safe</code>: web safe tag name for URL.
</li>
<li><code>count</code>: how many time the tag is used.
</li>
<li><code>size</code>: the font size in percent.
</li>
</ul>


<p>
Example:
</p>



<pre class=\"src src-emacs-lisp\"><span style=\"color: #ff4500;\">;; </span><span style=\"color: #ff4500;\">get the name of the tag defined in variable TAG.</span>
(ob:tags-name TAG)
</pre>


</div>
</div>

</div>

<div id=\"outline-container-2\" class=\"outline-3\">
<h3 id=\"sec-2\">变量</h3>
<div class=\"outline-text-3\" id=\"text-2\">


<p>
Following variables are always available when publishing a blog:
</p>
<ul>
<li><code>BLOG</code> (<code>ob:blog</code>): information about the blog being published.
</li>
<li><code>POSTS</code> (list of <code>ob:post</code>): list of all posts of the blog or restricted
   list of posts (depending what is exported).
</li>
<li><code>ALL-POSTS</code>: A copy of <code>POSTS</code> except this <b>always</b> contents all the
   posts from the blog.
</li>
<li><code>STATIC</code> (list of <code>ob:post</code>): list of static pages.
</li>
<li><code>SNIPPETS</code> (list of <code>ob:post</code>): list of snippets pages.
</li>
<li><code>TAGS</code> (list of <code>ob:tags</code>): list of all tags.
</li>
</ul>


<p>
Some variables may be defined in some functions:
</p>
<ul>
<li><code>POST</code> (<code>ob:post</code>): post (or static page) being currently published.
</li>
<li><code>TAG</code> (<code>ob:tags</code>): tag being currently published.
</li>
<li><code>CATEGORY</code> (<code>string</code>): the category being published.
</li>
<li><code>YEAR</code>, <code>MONTH (=integer</code>): the year and month being published.
</li>
<li><code>PATH-TO-ROOT</code> (<code>string</code>): (intern use only, use <code>ob:path-to-root</code>
   instead) path to blog root used by <code>ob:path-to-root</code>.
</li>
</ul>

</div>
</div>
"

函数

导出博文信息 函数
属性
id
7
title
"函数"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"blog_static.html"
filepath
nil
filename
"functions"
htmlfile
"functions.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


Basically any lisp function could be used withing a blog template as long as
they are known when exporting. Meanwhile some of them are specifically made
to be used withing templates. These functions are prefixed by =ob:=.

Descriptions are taken from function docstrings.

** Function: =(ob:get-posts &optional PREDICATE COUNT SORTFUNC COLLECT)=

Return posts (from =POSTS= as defined in =org-publish-blog=) matching
=PREDICATE=. Limit to =COUNT= results if defined and sorted using
=SORTFUNC=.

=PREDICATE= is a function run for each post with the post itself as
argument. If =PREDICATE= is nil, no filter would be done on posts.

=SORTFUNC= is used a =sort= =PREDICATE=.

If =COLLECT= is defined, only returns the =COLLECT= field of a
=ob:post= structure.

Examples:

Getting last 10 posts:

#+begin_src emacs-lisp
   (ob:get-posts nil 10)
#+end_src


Getting post from January 2012:

#+begin_src emacs-lisp
   (ob:get-posts
      (lambda (x)
         (and (= 2012 (ob:post-year x))
              (= 1 (ob:post-month x)))))
#+end_src

Getting all categories:

#+begin_src emacs-lisp
    (ob:get-posts nil nil nil 'category)
#+end_src


*** Template usages

For archive navigation:

#+begin_src html
  <nav id=\"archives\">
    <h1>Archives</h1>
    <ul>
      <lisp>
        (loop for p in (ob:get-posts nil 10)
              do (insert (format \"<li><a href=\\\"%s/%s\\\">%s</a></li> \"
                                 (ob:path-to-root)
                                 (ob:post-htmlfile p)
                                 (ob:post-title p))))
      </lisp>
    </ul>
  </nav>
#+end_src

** Function: =(ob:get-post-by-id ID)=

Return post which id is =ID=.

*** Template usages

Posts navigation:

#+begin_src html
  <nav class=\"articles-nav\">
    <ul>
      <lisp>
        (progn
          ;; Get previous post
          (let ((ppost (ob:get-post-by-id (1+ (ob:post-id POST)))))
            (if ppost
                (insert (format \"<li class=\\\"prev\\\"><a href=\\\"%s/%s\\\">%s</a></li>\"
                                (ob:path-to-root)
                                (ob:post-htmlfile ppost)
                                (ob:post-title ppost)))
              (insert \"<li>&nbsp;</li>\")))
          ;; Get next post
          (let ((npost (ob:get-post-by-id (1- (ob:post-id POST)))))
            (if npost
                (insert (format \"<li class=\\\"next\\\"><a href=\\\"%s/%s\\\">%s</a></li>\"
                                (ob:path-to-root)
                                (ob:post-htmlfile npost)
                                (ob:post-title npost)))
              (insert \"<li>&nbsp;</li>\"))))
      </lisp>
    </ul>
  </nav>
#+end_src

** Function: =(ob:get-snippet NAME)=

Get first snippet matching =NAME=.

*** Template usages

Insert the /About/ section in page footer:

#+begin_src html
  <h1>About</h1>
  <address>
    <lisp>(ob:post-content-html (ob:get-snippet \"About\"))</lisp>
  </address>
#+end_src

** Function: =(ob:get-header HEADER &optional ALL)=

Get =HEADER= from blog buffer as defined in =BLOG= global context variable.

Returns only fist match except if =ALL= is defined.

*** Template usages

Get the last updated header for rss export:

#+begin_src html
  <updated><lisp>(ob:format-date (ob:get-header \"DATE\"))</lisp></updated>
#+end_src

** Function: =(ob:insert-template TEMPLATE)=

Insert =TEMPLATE= in current buffer.

*** Template usages

Insert html header:

#+begin_src html
  <lisp>(ob:insert-template \"page_header.html\")</lisp>
#+end_src

** Function: =(ob:format-date DATE &optional FORMAT LOCALE)=

Format =DATE= using =FORMAT= and =LOCALE=.

=DATE= can heither be string suitable for =parse-time-string= or a list of
interger using =current-time= format.

=FORMAT= is a =format-time-string= compatible definition. If not
set ISO8601 =%Y-%m-%dT%TZ= format would be used.

*** Template usages

Add a human readable timestamp for a post:

#+begin_src html
  Posted on <time datetime=\"<lisp> (ob:format-date (ob:post-timestamp POST)) </lisp>\">
    <lisp> (ob:format-date (ob:post-timestamp POST) \"%A %B, %d %Y at %H:%M:%S\") </lisp>
  </time>.
#+end_src
"
content-html
"<p>
Basically any lisp function could be used withing a blog template as long as
they are known when exporting. Meanwhile some of them are specifically made
to be used withing templates. These functions are prefixed by <code>ob:</code>.
</p>
<p>
Descriptions are taken from function docstrings.
</p>

<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">Function: <code>(ob:get-posts &amp;optional PREDICATE COUNT SORTFUNC COLLECT)</code></h3>
<div class=\"outline-text-3\" id=\"text-1\">


<p>
Return posts (from <code>POSTS</code> as defined in <code>org-publish-blog</code>) matching
<code>PREDICATE</code>. Limit to <code>COUNT</code> results if defined and sorted using
<code>SORTFUNC</code>.
</p>
<p>
<code>PREDICATE</code> is a function run for each post with the post itself as
argument. If <code>PREDICATE</code> is nil, no filter would be done on posts.
</p>
<p>
<code>SORTFUNC</code> is used a <code>sort</code> <code>PREDICATE</code>.
</p>
<p>
If <code>COLLECT</code> is defined, only returns the <code>COLLECT</code> field of a
<code>ob:post</code> structure.
</p>
<p>
Examples:
</p>
<p>
Getting last 10 posts:
</p>



<pre class=\"src src-emacs-lisp\">(ob:get-posts nil 10)
</pre>



<p>
Getting post from January 2012:
</p>



<pre class=\"src src-emacs-lisp\">(ob:get-posts
   (<span style=\"color: #00ffff;\">lambda</span> (x)
      (and (= 2012 (ob:post-year x))
           (= 1 (ob:post-month x)))))
</pre>


<p>
Getting all categories:
</p>



<pre class=\"src src-emacs-lisp\">(ob:get-posts nil nil nil 'category)
</pre>




</div>

<div id=\"outline-container-1-1\" class=\"outline-4\">
<h4 id=\"sec-1-1\">Template usages</h4>
<div class=\"outline-text-4\" id=\"text-1-1\">


<p>
For archive navigation:
</p>



<pre class=\"src src-html\">&lt;<span style=\"color: #87cefa;\">nav</span> <span style=\"color: #eedd82;\">id</span>=<span style=\"color: #ffa07a;\">\"archives\"</span>&gt;
  &lt;<span style=\"color: #87cefa;\">h1</span>&gt;<span style=\"font-weight: bold; text-decoration: underline;\">Archives</span>&lt;/<span style=\"color: #87cefa;\">h1</span>&gt;
  &lt;<span style=\"color: #87cefa;\">ul</span>&gt;
    &lt;<span style=\"color: #87cefa;\">lisp</span>&gt;
      (loop for p in (ob:get-posts nil 10)
            do (insert (format <span style=\"color: #ffa07a;\">\"&lt;li&gt;&lt;a href=\\\"</span><span style=\"color: #eedd82;\">%s</span>/<span style=\"color: #eedd82;\">%s</span>\\<span style=\"color: #ffa07a;\">\"&gt;%s&lt;/a&gt;&lt;/li&gt; \"</span>
                               (ob:path-to-root)
                               (ob:post-htmlfile p)
                               (ob:post-title p))))
    &lt;/<span style=\"color: #87cefa;\">lisp</span>&gt;
  &lt;/<span style=\"color: #87cefa;\">ul</span>&gt;
&lt;/<span style=\"color: #87cefa;\">nav</span>&gt;
</pre>


</div>
</div>

</div>

<div id=\"outline-container-2\" class=\"outline-3\">
<h3 id=\"sec-2\">Function: <code>(ob:get-post-by-id ID)</code></h3>
<div class=\"outline-text-3\" id=\"text-2\">


<p>
Return post which id is <code>ID</code>.
</p>

</div>

<div id=\"outline-container-2-1\" class=\"outline-4\">
<h4 id=\"sec-2-1\">Template usages</h4>
<div class=\"outline-text-4\" id=\"text-2-1\">


<p>
Posts navigation:
</p>



<pre class=\"src src-html\">&lt;<span style=\"color: #87cefa;\">nav</span> <span style=\"color: #eedd82;\">class</span>=<span style=\"color: #ffa07a;\">\"articles-nav\"</span>&gt;
  &lt;<span style=\"color: #87cefa;\">ul</span>&gt;
    &lt;<span style=\"color: #87cefa;\">lisp</span>&gt;
      (progn
        ;; Get previous post
        (let ((ppost (ob:get-post-by-id (1+ (ob:post-id POST)))))
          (if ppost
              (insert (format <span style=\"color: #ffa07a;\">\"&lt;li class=\\\"</span>prev\\<span style=\"color: #ffa07a;\">\"&gt;&lt;a href=\\\"</span><span style=\"color: #eedd82;\">%s</span>/<span style=\"color: #eedd82;\">%s</span>\\<span style=\"color: #ffa07a;\">\"&gt;%s&lt;/a&gt;&lt;/li&gt;\"</span>
                              (ob:path-to-root)
                              (ob:post-htmlfile ppost)
                              (ob:post-title ppost)))
            (insert <span style=\"color: #ffa07a;\">\"&lt;li&gt;&amp;nbsp;&lt;/li&gt;\"</span>)))
        ;; Get next post
        (let ((npost (ob:get-post-by-id (1- (ob:post-id POST)))))
          (if npost
              (insert (format <span style=\"color: #ffa07a;\">\"&lt;li class=\\\"</span>next\\<span style=\"color: #ffa07a;\">\"&gt;&lt;a href=\\\"</span><span style=\"color: #eedd82;\">%s</span>/<span style=\"color: #eedd82;\">%s</span>\\<span style=\"color: #ffa07a;\">\"&gt;%s&lt;/a&gt;&lt;/li&gt;\"</span>
                              (ob:path-to-root)
                              (ob:post-htmlfile npost)
                              (ob:post-title npost)))
            (insert <span style=\"color: #ffa07a;\">\"&lt;li&gt;&amp;nbsp;&lt;/li&gt;\"</span>))))
    &lt;/<span style=\"color: #87cefa;\">lisp</span>&gt;
  &lt;/<span style=\"color: #87cefa;\">ul</span>&gt;
&lt;/<span style=\"color: #87cefa;\">nav</span>&gt;
</pre>


</div>
</div>

</div>

<div id=\"outline-container-3\" class=\"outline-3\">
<h3 id=\"sec-3\">Function: <code>(ob:get-snippet NAME)</code></h3>
<div class=\"outline-text-3\" id=\"text-3\">


<p>
Get first snippet matching <code>NAME</code>.
</p>

</div>

<div id=\"outline-container-3-1\" class=\"outline-4\">
<h4 id=\"sec-3-1\">Template usages</h4>
<div class=\"outline-text-4\" id=\"text-3-1\">


<p>
Insert the <i>About</i> section in page footer:
</p>



<pre class=\"src src-html\">&lt;<span style=\"color: #87cefa;\">h1</span>&gt;<span style=\"font-weight: bold; text-decoration: underline;\">About</span>&lt;/<span style=\"color: #87cefa;\">h1</span>&gt;
&lt;<span style=\"color: #87cefa;\">address</span>&gt;
  &lt;<span style=\"color: #87cefa;\">lisp</span>&gt;(ob:post-content-html (ob:get-snippet <span style=\"color: #ffa07a;\">\"About\"</span>))&lt;/<span style=\"color: #87cefa;\">lisp</span>&gt;
&lt;/<span style=\"color: #87cefa;\">address</span>&gt;
</pre>


</div>
</div>

</div>

<div id=\"outline-container-4\" class=\"outline-3\">
<h3 id=\"sec-4\">Function: <code>(ob:get-header HEADER &amp;optional ALL)</code></h3>
<div class=\"outline-text-3\" id=\"text-4\">


<p>
Get <code>HEADER</code> from blog buffer as defined in <code>BLOG</code> global context variable.
</p>
<p>
Returns only fist match except if <code>ALL</code> is defined.
</p>

</div>

<div id=\"outline-container-4-1\" class=\"outline-4\">
<h4 id=\"sec-4-1\">Template usages</h4>
<div class=\"outline-text-4\" id=\"text-4-1\">


<p>
Get the last updated header for rss export:
</p>



<pre class=\"src src-html\">&lt;<span style=\"color: #87cefa;\">updated</span>&gt;&lt;<span style=\"color: #87cefa;\">lisp</span>&gt;(ob:format-date (ob:get-header <span style=\"color: #ffa07a;\">\"DATE\"</span>))&lt;/<span style=\"color: #87cefa;\">lisp</span>&gt;&lt;/<span style=\"color: #87cefa;\">updated</span>&gt;
</pre>


</div>
</div>

</div>

<div id=\"outline-container-5\" class=\"outline-3\">
<h3 id=\"sec-5\">Function: <code>(ob:insert-template TEMPLATE)</code></h3>
<div class=\"outline-text-3\" id=\"text-5\">


<p>
Insert <code>TEMPLATE</code> in current buffer.
</p>

</div>

<div id=\"outline-container-5-1\" class=\"outline-4\">
<h4 id=\"sec-5-1\">Template usages</h4>
<div class=\"outline-text-4\" id=\"text-5-1\">


<p>
Insert html header:
</p>



<pre class=\"src src-html\">&lt;<span style=\"color: #87cefa;\">lisp</span>&gt;(ob:insert-template <span style=\"color: #ffa07a;\">\"page_header.html\"</span>)&lt;/<span style=\"color: #87cefa;\">lisp</span>&gt;
</pre>


</div>
</div>

</div>

<div id=\"outline-container-6\" class=\"outline-3\">
<h3 id=\"sec-6\">Function: <code>(ob:format-date DATE &amp;optional FORMAT LOCALE)</code></h3>
<div class=\"outline-text-3\" id=\"text-6\">


<p>
Format <code>DATE</code> using <code>FORMAT</code> and <code>LOCALE</code>.
</p>
<p>
<code>DATE</code> can heither be string suitable for <code>parse-time-string</code> or a list of
interger using <code>current-time</code> format.
</p>
<p>
<code>FORMAT</code> is a <code>format-time-string</code> compatible definition. If not
set ISO8601 <code>%Y-%m-%dT%TZ</code> format would be used.
</p>

</div>

<div id=\"outline-container-6-1\" class=\"outline-4\">
<h4 id=\"sec-6-1\">Template usages</h4>
<div class=\"outline-text-4\" id=\"text-6-1\">


<p>
Add a human readable timestamp for a post:
</p>



<pre class=\"src src-html\">Posted on &lt;<span style=\"color: #87cefa;\">time</span> <span style=\"color: #eedd82;\">datetime</span>=<span style=\"color: #ffa07a;\">\"&lt;lisp&gt; (ob:format-date (ob:post-timestamp POST)) &lt;/lisp&gt;\"</span>&gt;
  &lt;<span style=\"color: #87cefa;\">lisp</span>&gt; (ob:format-date (ob:post-timestamp POST) <span style=\"color: #ffa07a;\">\"%A %B, %d %Y at %H:%M:%S\"</span>) &lt;/<span style=\"color: #87cefa;\">lisp</span>&gt;
&lt;/<span style=\"color: #87cefa;\">time</span>&gt;.
</pre>

</div>
</div>
</div>
"

报告软件臭虫 (BUG)

导出博文信息 报告软件臭虫 (BUG)
属性
id
8
title
"报告软件臭虫 (BUG)"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"blog_static.html"
filepath
nil
filename
"bug-report"
htmlfile
"bug-report.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


To report a bug please be sure your issue is =o-blog= related.

You can bootstrap a simple clean environment

#+begin_src sh
rm -rf ~/dev/.emacs.d
mkdir -p ~/dev/.emacs.d
cd ~/dev/.emacs.d
git clone git://github.com/renard/o-blog.git
git clone git://orgmode.org/org-mode.git
#+end_src


Then launch =emacs=:

#+begin_src sh
  cd ~/dev
  rm -rf .emacs.d/o-blog/example/out
  emacs --debug-init -Q  -l .emacs.d/o-blog/sample-init.el --eval \\
      '(progn (setq browse-url-generic-program \"x-www-browser\"
        browse-url-browser-function (quote browse-url-generic))
        (ob-build-sample))'
#+end_src

You can change =x-www-browser= to your favorite browser.

If anything runs fine emacs would exit normally. Otherwise a buffer called
=o-blog Bug-report= is created and its content is copied to primary X
selection (if available). This buffer contains useful information for
debugging your issue. A browser is launch to the [[https://github.com/renard/o-blog/issues/new][o-blog new issue page]]. You
can either paste content of the =o-blog Bug-report= buffer or the X primary
selection (middle click).

Please describe as much as possible your issue (in English). do no hesitate
to paste your blog file to https://gist.github.com/ this might be useful to
debug.


"
content-html
"<p>
To report a bug please be sure your issue is <code>o-blog</code> related.
</p>
<p>
You can bootstrap a simple clean environment
</p>



<pre class=\"src src-sh\">rm -rf ~/dev/.emacs.d
mkdir -p ~/dev/.emacs.d
<span style=\"color: #b0c4de;\">cd</span> ~/dev/.emacs.d
git clone git://github.com/renard/o-blog.git
git clone git://orgmode.org/org-mode.git
</pre>



<p>
Then launch <code>emacs</code>:
</p>



<pre class=\"src src-sh\"><span style=\"color: #b0c4de;\">cd</span> ~/dev
rm -rf .emacs.d/o-blog/example/out
emacs --debug-init -Q  -l .emacs.d/o-blog/sample-init.el --eval <span style=\"color: #ffa07a;\">\\</span>
    <span style=\"color: #ffa07a;\">'(progn (setq browse-url-generic-program \"x-www-browser\"</span>
<span style=\"color: #ffa07a;\">      browse-url-browser-function (quote browse-url-generic))</span>
<span style=\"color: #ffa07a;\">      (ob-build-sample))'</span>
</pre>


<p>
You can change <code>x-www-browser</code> to your favorite browser.
</p>
<p>
If anything runs fine emacs would exit normally. Otherwise a buffer called
<code>o-blog Bug-report</code> is created and its content is copied to primary X
selection (if available). This buffer contains useful information for
debugging your issue. A browser is launch to the <a href=\"https://github.com/renard/o-blog/issues/new\">o-blog new issue page</a>. You
can either paste content of the <code>o-blog Bug-report</code> buffer or the X primary
selection (middle click).
</p>
<p>
Please describe as much as possible your issue (in English). do no hesitate
to paste your blog file to <a href=\"https://gist.github.com/\">https://gist.github.com/</a> this might be useful to
debug.
</p>

"

用户推荐

导出博文信息 用户推荐
属性
id
9
title
"用户推荐"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"blog_static_no_title.html"
filepath
nil
filename
"testimonials"
htmlfile
"testimonials.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


#+BEGIN_HTML
<div class=\"row \"><div class=\"span6 \">
#+END_HTML



#+HTML: <h1>用户推荐</h1>

#+begin_quote
/“o-blog, great static site generator from emacs Org-mode.”/

-- Pierre-Yves Ritschard [[https://twitter.com/pyr/status/160466727195521024][@pyr]] ([[http://openbds.org][OpenBSD]] relayd original author)

-- Sergey Konoplev [[http://twitter.com/gray_hemp][@gray\\_hemp]] ([[http://PostgreSQL-Consulting.com][PostgreSQL Consultant]])

-- Olivier Berger [[http://twitter.com/olberger][@olberger]] ([[http://www.april.org][APRIL administrator]])

-- Dimitri Fontaine [[http://twitter.com/tapoueh][@tapoueh]] ([[http://tapoueh.org/projects.html][el-get and other]] author)

-- Julien Danjou [[http://twitter.com/juldanjou][@juldanjou]] ([[http://awesome.naquadah.org/][Awesome window manager]] and [[http://julien.danjou.info/software/][other]] author)

-- Daniel Farina [[http://twitter.com/danfarina][@danfarina]] (member of the [[http://www.heroku.com/][Heroku]] Department of Data)
#+end_quote

#+begin_quote
/“o-blog, a cool static blog generator from org-mode markup with some nice
Bootstrap integration.”/

-- [[http://from-the-cloud.com/en/Random/2012/06/17_sites-back.html][Fabián Ezequiel Gallina]]
#+end_quote

#+begin_quote
/“Thank you so much for the truly excellent elisp app. I am learning many
things from it.”/

-- [[https://github.com/priyadarshan][priyadarshan]]
#+end_quote

#+begin_quote
/“o-blog looks awesome!”/

-- [[https://github.com/djcb][Dirk-Jan C. Binnema]] (Author of [[http://www.djcbsoftware.nl/code/mu4e][mu4e]] and [[http://emacs-fu.blogspot.com][emacs-fu]])
#+end_quote

#+begin_quote
/“o-blog is amazing. After using Wordpress seemingly since the dawn of time, then Jekyll for a couple of years, this is like a spring breeze after a long, cold winter.”/

-- [[https://github.com/fravashi][Farasha Euker]]
#+end_quote



#+BEGIN_HTML
</div><div class=\"span6 \">
#+END_HTML


#+BEGIN_HTML
<div class=\"hero-unit\">

#+END_HTML


#+HTML: <h1>他们在使用 o-blog</h1>

- [[http://renard.github.com/o-blog][O-blog Project]]
- [[http://docs.chezwam.org][Mes doc à moi]]
- [[http://from-the-cloud.com/][From the cloud]]
- [[http://exaos.github.com/o-blog/][exaos]]
- [[http://mikio.github.com/index.html][Mikio Kun]]
- [[http://mimes.is/][Journal of the creative imagination]]
- [[http://www.djcbsoftware.nl][DJCB Software]]
- [[http://dimilar.com/de/index.html][Erlang Vision]]
- [[http://pharos-alexandria.github.com][Pharos (Annette von Stockhausen)]]


#+BEGIN_HTML
</div>

#+END_HTML



#+BEGIN_HTML
<div class=\"hero-unit\">

#+END_HTML

如果您也在使用 o-blog, 给作者 [[https://github.com/renard/o-blog/issues/new][留句话]] 吧。

#+BEGIN_HTML
</div>

#+END_HTML




#+BEGIN_HTML
</div></div>
#+END_HTML


"
content-html
"<div class=\"row \"><div class=\"span6 \">





<h1>用户推荐</h1>

<blockquote>

<p><i>“o-blog, great static site generator from emacs Org-mode.”</i>
</p>
<p>
&ndash; Pierre-Yves Ritschard <a href=\"https://twitter.com/pyr/status/160466727195521024\">@pyr</a> (<a href=\"http://openbds.org\">OpenBSD</a> relayd original author)
</p>
<p>
&ndash; Sergey Konoplev <a href=\"http://twitter.com/gray_hemp\">@gray_hemp</a> (<a href=\"http://PostgreSQL-Consulting.com\">PostgreSQL Consultant</a>)
</p>
<p>
&ndash; Olivier Berger <a href=\"http://twitter.com/olberger\">@olberger</a> (<a href=\"http://www.april.org\">APRIL administrator</a>)
</p>
<p>
&ndash; Dimitri Fontaine <a href=\"http://twitter.com/tapoueh\">@tapoueh</a> (<a href=\"http://tapoueh.org/projects.html\">el-get and other</a> author)
</p>
<p>
&ndash; Julien Danjou <a href=\"http://twitter.com/juldanjou\">@juldanjou</a> (<a href=\"http://awesome.naquadah.org/\">Awesome window manager</a> and <a href=\"http://julien.danjou.info/software/\">other</a> author)
</p>
<p>
&ndash; Daniel Farina <a href=\"http://twitter.com/danfarina\">@danfarina</a> (member of the <a href=\"http://www.heroku.com/\">Heroku</a> Department of Data)
</p>
</blockquote>


<blockquote>

<p><i>“o-blog, a cool static blog generator from org-mode markup with some nice Bootstrap integration.”</i>
</p>
<p>
&ndash; <a href=\"http://from-the-cloud.com/en/Random/2012/06/17_sites-back.html\">Fabián Ezequiel Gallina</a>
</p>
</blockquote>


<blockquote>

<p><i>“Thank you so much for the truly excellent elisp app. I am learning many things from it.”</i>
</p>
<p>
&ndash; <a href=\"https://github.com/priyadarshan\">priyadarshan</a>
</p>
</blockquote>


<blockquote>

<p><i>“o-blog looks awesome!”</i>
</p>
<p>
&ndash; <a href=\"https://github.com/djcb\">Dirk-Jan C. Binnema</a> (Author of <a href=\"http://www.djcbsoftware.nl/code/mu4e\">mu4e</a> and <a href=\"http://emacs-fu.blogspot.com\">emacs-fu</a>)
</p>
</blockquote>


<blockquote>

<p><i>“o-blog is amazing. After using Wordpress seemingly since the dawn of time, then Jekyll for a couple of years, this is like a spring breeze after a long, cold winter.”</i>
</p>
<p>
&ndash; <a href=\"https://github.com/fravashi\">Farasha Euker</a>
</p>
</blockquote>






</div><div class=\"span6 \">


<div class=\"hero-unit\">





<h1>他们在使用 o-blog</h1>

<ul>
<li><a href=\"http://renard.github.com/o-blog\">O-blog Project</a>
</li>
<li><a href=\"http://docs.chezwam.org\">Mes doc à moi</a>
</li>
<li><a href=\"http://from-the-cloud.com/\">From the cloud</a>
</li>
<li><a href=\"http://exaos.github.com/o-blog/\">exaos</a>
</li>
<li><a href=\"http://mikio.github.com/index.html\">Mikio Kun</a>
</li>
<li><a href=\"http://mimes.is/\">Journal of the creative imagination</a>
</li>
<li><a href=\"http://www.djcbsoftware.nl\">DJCB Software</a>
</li>
<li><a href=\"http://dimilar.com/de/index.html\">Erlang Vision</a>
</li>
<li><a href=\"http://pharos-alexandria.github.com\">Pharos (Annette von Stockhausen)</a>
</li>
</ul>





</div>




<div class=\"hero-unit\">


<p>
如果您也在使用 o-blog, 给作者 <a href=\"https://github.com/renard/o-blog/issues/new\">留句话</a> 吧。
</p>


</div>





</div></div>


"

发展规划

导出博文信息 发展规划
属性
id
10
title
"发展规划"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"blog_static.html"
filepath
nil
filename
"roadmap"
htmlfile
"roadmap.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


Here are some ideas for future versions

- Use other source engines such as
  - [[http://www.methods.co.nz/asciidoc/][AsciiDoc]]
  - [[http://mwolson.org/projects/EmacsMuse.html][Emacs Muse]]
  - etc...

- Find a other name for the project such as
  - Web Hypertext Otimized Rendering Easy System
  - Building the Interweb from Texts Classic Hypermedia
  - Build All Internet Standard E-documents
  - Publication Unifiée de Tous E-documents
  - el-site
  - el-sitemanage
  - el-sitepublish
  - el-sitepress

If you have any ideas please [[https://github.com/renard/o-blog/issues/new][drop me a line]].



"
content-html
"<p>
Here are some ideas for future versions
</p>
<ul>
<li>Use other source engines such as
<ul>
<li><a href=\"http://www.methods.co.nz/asciidoc/\">AsciiDoc</a>
</li>
<li><a href=\"http://mwolson.org/projects/EmacsMuse.html\">Emacs Muse</a>
</li>
<li>etc&hellip;

</li>
</ul>

</li>
<li>Find a other name for the project such as
<ul>
<li>Web Hypertext Otimized Rendering Easy System
</li>
<li>Building the Interweb from Texts Classic Hypermedia
</li>
<li>Build All Internet Standard E-documents
</li>
<li>Publication Unifiée de Tous E-documents
</li>
<li>el-site
</li>
<li>el-sitemanage
</li>
<li>el-sitepublish
</li>
<li>el-sitepress
</li>
</ul>

</li>
</ul>


<p>
If you have any ideas please <a href=\"https://github.com/renard/o-blog/issues/new\">drop me a line</a>.
</p>


"

问答

导出博文信息 问答
属性
id
11
title
"问答"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "文档" "32536950c0eb5cb77d8024b690f5a038"]
tags
nil
template
"blog_static.html"
filepath
nil
filename
"faq"
htmlfile
"faq.html"
path-to-root
"."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


** 页面看起来丑丑的~~

Maybe you are using [[https://www.google.com/chrome/][google-chrome]] and try to view your site locally using a
=file:///path/to/your/site/out/index.html= scheme. Open the javascript console
=Ctrl+Shift+I= you should see something like:

如果你使用的是 [[https://www.google.com/chrome/][google-chrome]] 并且用 =file:///path/to/your/site/out/index.html= 这
种方式来查看页面的话,用 =Ctrl+Shift+I= 打开 JavaScript 控制台,你可能会看到如下
类似的提示:

#+begin_example
XMLHttpRequest cannot load file:///path/to/your/site/out/out/style/css/o-blog.less. Cross origin requests are only supported for HTTP.
less-1.2.1.min.js:8Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101
#+end_example

这是 Chrome 载入本地 JavaScript 文件时的一个特点,这也是 Chrome 中的一个
/安全特性/ 。

你可以用选项 =--allow-file-access-from-files= 来关闭 Chrome 中的这个特点,或者你可以使用另一个浏览器或者设置一个本地的网页服务器。

有许多复杂的网页服务器解决方案,比如 [[http://nginx.org/][nginx]] 或 [[http://httpd.apache.org/][Apache]] 或许多 [[http://en.wikipedia.org/wiki/Comparison_of_web_server_software][其它的网页服务软件]]。

你可能会优先选择一个轻量级的简单解决方案。

使用 Python, 只需要简单地运行:

#+begin_src sh
cd /path/to/your/site && python -m SimpleHTTPServer
#+end_src

然后浏览 http://localhost:8000

在 Emacs 中你还可以使用 [[https://github.com/jrhbailey/emacs-http-server][emacs-http-server]]:

#+begin_src emacs-lisp
(require 'httpd)
(setq httpd-root \"/path/to/your/site\")
(httpd-start)
#+end_src

然后浏览 http://localhost:8080

其它的替代方法还有使用 [[http://www.emacswiki.org/emacs/Elnode][elnode]], 但它好象更复杂些。

** Why html pages are not minified?

HTML compression very tricky. Things can easily go wrong. Using a
[[http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/][GZip
compression]] would be more efficient.

Anyway if you still want to minify your pages, you can have a look to
[[http://code.google.com/p/htmlcompressor/][htmlcompressor]],
[[http://developer.yahoo.com/yui/compressor/][yuicompressor]] and
[[https://developers.google.com/closure/compiler/][Closure compiler]]. You
can also read Juriy Zaytsev's articles on
[[http://perfectionkills.com/optimizing-html/][optimizing HTML]] and
[[http://perfectionkills.com/experimenting-with-html-minifier/][experimenting
with html minifier]].

So here is the magic! Once your site is generated, you can run the following command:

#+BEGIN_SRC sh
htmlcompressor --compress-js --compress-css --recursive --mask '*.js;*.html;*.xml;*.css;*.less' -o /path/to/out/ /path/to/out
#+END_SRC

"
content-html
"<div id=\"outline-container-1\" class=\"outline-3\">
<h3 id=\"sec-1\">页面看起来丑丑的~~</h3>
<div class=\"outline-text-3\" id=\"text-1\">


<p>
Maybe you are using <a href=\"https://www.google.com/chrome/\">google-chrome</a> and try to view your site locally using a
<code>file:///path/to/your/site/out/index.html</code> scheme. Open the javascript console
<code>Ctrl+Shift+I</code> you should see something like:
</p>
<p>
如果你使用的是 <a href=\"https://www.google.com/chrome/\">google-chrome</a> 并且用 <code>file:///path/to/your/site/out/index.html</code> 这
种方式来查看页面的话,用 <code>Ctrl+Shift+I</code> 打开 JavaScript 控制台,你可能会看到如下
类似的提示:
</p>



<pre class=\"example\">XMLHttpRequest cannot load file:///path/to/your/site/out/out/style/css/o-blog.less. Cross origin requests are only supported for HTTP.
less-1.2.1.min.js:8Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101
</pre>


<p>
这是 Chrome 载入本地 JavaScript 文件时的一个特点,这也是 Chrome 中的一个
<i>安全特性</i> 。
</p>
<p>
你可以用选项 <code>--allow-file-access-from-files</code> 来关闭 Chrome 中的这个特点,或者你可以使用另一个浏览器或者设置一个本地的网页服务器。
</p>
<p>
有许多复杂的网页服务器解决方案,比如 <a href=\"http://nginx.org/\">nginx</a> 或 <a href=\"http://httpd.apache.org/\">Apache</a> 或许多 <a href=\"http://en.wikipedia.org/wiki/Comparison_of_web_server_software\">其它的网页服务软件</a>。
</p>
<p>
你可能会优先选择一个轻量级的简单解决方案。
</p>
<p>
使用 Python, 只需要简单地运行:
</p>



<pre class=\"src src-sh\"><span style=\"color: #b0c4de;\">cd</span> /path/to/your/site &amp;&amp; python -m SimpleHTTPServer
</pre>


<p>
然后浏览 <a href=\"http://localhost:8000\">http://localhost:8000</a>
</p>
<p>
在 Emacs 中你还可以使用 <a href=\"https://github.com/jrhbailey/emacs-http-server\">emacs-http-server</a>:
</p>



<pre class=\"src src-emacs-lisp\">(<span style=\"color: #00ffff;\">require</span> '<span style=\"color: #7fffd4;\">httpd</span>)
(setq httpd-root <span style=\"color: #ffa07a;\">\"/path/to/your/site\"</span>)
(httpd-start)
</pre>


<p>
然后浏览 <a href=\"http://localhost:8080\">http://localhost:8080</a>
</p>
<p>
其它的替代方法还有使用 <a href=\"http://www.emacswiki.org/emacs/Elnode\">elnode</a>, 但它好象更复杂些。
</p>
</div>

</div>

<div id=\"outline-container-2\" class=\"outline-3\">
<h3 id=\"sec-2\">Why html pages are not minified?</h3>
<div class=\"outline-text-3\" id=\"text-2\">


<p>
HTML compression very tricky. Things can easily go wrong. Using a
<a href=\"http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/\">GZip compression</a> would be more efficient.
</p>
<p>
Anyway if you still want to minify your pages, you can have a look to
<a href=\"http://code.google.com/p/htmlcompressor/\">htmlcompressor</a>,
<a href=\"http://developer.yahoo.com/yui/compressor/\">yuicompressor</a> and
<a href=\"https://developers.google.com/closure/compiler/\">Closure compiler</a>. You
can also read Juriy Zaytsev's articles on
<a href=\"http://perfectionkills.com/optimizing-html/\">optimizing HTML</a> and
<a href=\"http://perfectionkills.com/experimenting-with-html-minifier/\">experimenting with html minifier</a>.
</p>
<p>
So here is the magic! Once your site is generated, you can run the following command:
</p>



<pre class=\"src src-sh\">htmlcompressor --compress-js --compress-css --recursive --mask <span style=\"color: #ffa07a;\">'*.js;*.html;*.xml;*.css;*.less'</span> -o /path/to/out/ /path/to/out
</pre>


</div>
</div>
"

Redirect from (一些 org 语法示例)

导出博文信息 Redirect from (一些 org 语法示例)
属性
id
nil
title
"Redirect from (一些 org 语法示例)"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "Tips" "tips"]
tags
nil
template
"page_redirect.html"
filepath
"tips/2012/01/07_syntax-org-mode/"
filename
"index"
htmlfile
"tips/2012/01/07_syntax-org-mode/index.html"
path-to-root
"../../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil

* Redirect from (一些 org 语法示例)
:PROPERTIES:
:PAGE: tips/2012/01/07_syntax-org-mode/index.html
:TEMPLATE: page_redirect.html
:END:"
content-html
"<div id=\"outline-container-1\" class=\"outline-2\">
<h2 id=\"sec-1\">Redirect from (一些 org 语法示例)</h2>
<div class=\"outline-text-2\" id=\"text-1\">

</div>
</div>
"

Redirect from (在博文中添加图片)

导出博文信息 Redirect from (在博文中添加图片)
属性
id
nil
title
"Redirect from (在博文中添加图片)"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "Tips" "tips"]
tags
nil
template
"page_redirect.html"
filepath
"tips/2012/08/21_00733d4efa6667a085bebed8a14b1026/"
filename
"index"
htmlfile
"tips/2012/08/21_00733d4efa6667a085bebed8a14b1026/index.html"
path-to-root
"../../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil

* Redirect from (在博文中添加图片)
:PROPERTIES:
:PAGE: tips/2012/08/21_00733d4efa6667a085bebed8a14b1026/index.html
:TEMPLATE: page_redirect.html
:END:"
content-html
"<div id=\"outline-container-1\" class=\"outline-2\">
<h2 id=\"sec-1\">Redirect from (在博文中添加图片)</h2>
<div class=\"outline-text-2\" id=\"text-1\">

</div>
</div>
"

Copyright

导出博文信息 Copyright
属性
id
0
title
"Copyright"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "博客设置" "788f2c7b101e31eb2a10d94e633dc717"]
tags
nil
template
"blog_post.html"
filepath
"788f2c7b101e31eb2a10d94e633dc717/2012/09"
filename
"copyright"
htmlfile
"788f2c7b101e31eb2a10d94e633dc717/2012/09/12_copyright.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


Copyright © 2008-2012 [[mailto:seb%2520%E2%9D%A8%C9%91%C6%A6%C9%B5%CF%90%C9%91%CA%82%C9%9B%E2%9D%A9%2520chezwam%2520%E2%9D%A8%C6%A4%C9%B5%C9%A9%C9%B2%CA%88%E2%9D%A9%2520org][Sébastien Gross]]. Published under the therm of the
[[http://creativecommons.org/licenses/by-nc-sa/2.0/fr/][Creative Commons Attribution-Noncommercial-Share Alike 2.0 France License]].
"
content-html
"<p>
Copyright © 2008-2012 <a href=\"mailto:seb%20❨ɑƦɵϐɑʂɛ❩%20chezwam%20❨Ƥɵɩɲʈ❩%20org\">Sébastien Gross</a>. Published under the therm of the
<a href=\"http://creativecommons.org/licenses/by-nc-sa/2.0/fr/\">Creative Commons Attribution-Noncommercial-Share Alike 2.0 France License</a>.
</p>"

About

导出博文信息 About
属性
id
1
title
"About"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "博客设置" "788f2c7b101e31eb2a10d94e633dc717"]
tags
nil
template
"blog_post.html"
filepath
"788f2c7b101e31eb2a10d94e633dc717/2012/09"
filename
"about"
htmlfile
"788f2c7b101e31eb2a10d94e633dc717/2012/09/12_about.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


这是个解释 [[https://github.com/renard/o-blog][o-blog]] 工作原理的博客样例。
"
content-html
"<p>
这是个解释 <a href=\"https://github.com/renard/o-blog\">o-blog</a> 工作原理的博客样例。
</p>"

Navigation

导出博文信息 Navigation
属性
id
2
title
"Navigation"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "博客设置" "788f2c7b101e31eb2a10d94e633dc717"]
tags
nil
template
"blog_post.html"
filepath
"788f2c7b101e31eb2a10d94e633dc717/2012/09"
filename
"navigation"
htmlfile
"788f2c7b101e31eb2a10d94e633dc717/2012/09/12_navigation.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


- [[file:../../../features.html][/icon-cog icon-white/ 特性]]

- [[#][/icon-book icon-white/ 文档]]
  - [[file:../../../templates.html][模版]]
  - [[file:../../../structures.html][文档结构]]
  - [[file:../../../functions.html][函数]]
  - 
  - [[file:../../../faq.html][FAQ]]
  - 
  - [[file:../../../bug-report.html][反馈软件缺陷]]

- [[#][/icon-file icon-white/ 近期博文]]
  - [[file:Lisp error in nil: (void-function format%20"%25s/%25s"%20)][Lisp error in nil: (void-variable "Tips")]]
  - [[file:Lisp error in nil: (void-function format%20"%25s/%25s"%20)][Lisp error in nil: (void-variable "Tips")]]
  - [[file:Lisp error in nil: (void-function format%20"%25s/%25s"%20)][Lisp error in nil: (void-variable "Tips")]]
  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]
  - [[file:Lisp error in nil: (void-variable "%s/%s")][Lisp error in nil: (void-variable "Tips")]]

- [[file:../../../tags/index.html][/icon-tags icon-white/ 标签]]

- [[file:../../../testimonials.html][/icon-comments-alt icon-white/ 用户推荐]]

- [[file:../../../index.xml][/icon-rss icon-white/ RSS]]

- [[file:../../../archives.html][/icon-list icon-white/ 归档]]

- [[file:../../../changelog.html][/icon-pencil icon-white/ 更新记录]]

- [[file:../../../roadmap.html][/icon-tasks icon-white/ 规划]]

- [[file:../../../debug.html][(调试)]]
"
content-html
"<ul>
<li><a href=\"../../../features.html\"><i>icon-cog icon-white</i> 特性</a>

</li>
<li><a href=\"#\"><i>icon-book icon-white</i> 文档</a>
<ul>
<li><a href=\"../../../templates.html\">模版</a>
</li>
<li><a href=\"../../../structures.html\">文档结构</a>
</li>
<li><a href=\"../../../functions.html\">函数</a>
</li>
<li>
</li>
<li><a href=\"../../../faq.html\">FAQ</a>
</li>
<li>
</li>
<li><a href=\"../../../bug-report.html\">反馈软件缺陷</a>

</li>
</ul>

</li>
<li><a href=\"#\"><i>icon-file icon-white</i> 近期博文</a>
<ul>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>
</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>
</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>
</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>
</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\">Lisp error in nil: (void-variable "Tips")</a>

</li>
</ul>

</li>
<li><a href=\"../../../tags/index.html\"><i>icon-tags icon-white</i> 标签</a>

</li>
<li><a href=\"../../../testimonials.html\"><i>icon-comments-alt icon-white</i> 用户推荐</a>

</li>
<li><a href=\"../../../index.xml\"><i>icon-rss icon-white</i> RSS</a>

</li>
<li><a href=\"../../../archives.html\"><i>icon-list icon-white</i> 归档</a>

</li>
<li><a href=\"../../../changelog.html\"><i>icon-pencil icon-white</i> 更新记录</a>

</li>
<li><a href=\"../../../roadmap.html\"><i>icon-tasks icon-white</i> 规划</a>

</li>
<li><a href=\"../../../debug.html\">(调试)</a>
</li>
</ul>

"

Navigation Footer

导出博文信息 Navigation Footer
属性
id
3
title
"Navigation Footer"
timespamp
(20559 24576)
year
2012
month
9
day
12
category
[cl-struct-ob:category "博客设置" "788f2c7b101e31eb2a10d94e633dc717"]
tags
nil
template
"blog_post.html"
filepath
"788f2c7b101e31eb2a10d94e633dc717/2012/09"
filename
"navigation-footer"
htmlfile
"788f2c7b101e31eb2a10d94e633dc717/2012/09/12_navigation-footer.html"
path-to-root
"../../.."
sitemap
nil
content
"#+OPTIONS: H:7 num:nil  toc:nil d:nil todo:nil <:nil pri:nil tags:nil


 - [[file:../../../index.html][/icon-home icon-white/ 首页]]

 - [[file:Lisp error in nil: (void-function let%20)][/icon-file icon-white/ 近期博文]]

 - [[file:../../../tags.html][/icon-tags icon-white/ 标签]]

 - [[file:../../../archives.html][/icon-list icon-white/ 归档博文]]

 - [[file:../../../testimonials.html][/icon-comments-alt icon-white/ 用户推荐]]

 - [[file:../../../roadmap.html][/icon-tasks icon-white/ 发展规划]]

 - [[file:../../../index.xml][/icon-rss icon-white/ 订阅摘要]]
"
content-html
"<ul>
<li><a href=\"../../../index.html\"><i>icon-home icon-white</i> 首页</a>

</li>
<li><a href=\"Lisp error in nil: (void-variable "%s/%s")\"><i>icon-file icon-white</i> 近期博文</a>

</li>
<li><a href=\"../../../tags.html\"><i>icon-tags icon-white</i> 标签</a>

</li>
<li><a href=\"../../../archives.html\"><i>icon-list icon-white</i> 归档博文</a>

</li>
<li><a href=\"../../../testimonials.html\"><i>icon-comments-alt icon-white</i> 用户推荐</a>

</li>
<li><a href=\"../../../roadmap.html\"><i>icon-tasks icon-white</i> 发展规划</a>

</li>
<li><a href=\"../../../index.xml\"><i>icon-rss icon-white</i> 订阅摘要</a>
</li>
</ul>

"

标签

Bootstrap

导出标签信息 "Bootstrap"
属性
name
"Bootstrap"
safe
"bootstrap"
count
6
size
150.0

html 5

导出标签信息 "html 5"
属性
name
"html 5"
safe
"html-5"
count
1
size
80.0

o-blog

导出标签信息 "o-blog"
属性
name
"o-blog"
safe
"o-blog"
count
5
size
136.0

org

导出标签信息 "org"
属性
name
"org"
safe
"org"
count
1
size
80.0

中文

导出标签信息 "中文"
属性
name
"中文"
safe
"a7bac2239fcdcb3a067903d8077c4a07"
count
1
size
80.0

用例

导出标签信息 "用例"
属性
name
"用例"
safe
"a0b1dd52a1c893aa52b103dad9aa9d59"
count
11
size
220.0