Writing Blog with org-mode

[2018-09-14 Fri]

Your Life in Plain Text

This blog is written in org-mode.

Org-mode is a strucutred text format like markdown. Org-mode and Emacs make our writing environment very confortable.

Emacs also has a exporting feature that publishes many format including pdf, latex and html. Emacs supports site-map feature so that we can export static site with articles and an index.html by one command.

Actually, there are many writers who love org-mode. And they heavily customize org-mode with elisp.

Painful elisp

Despite, learning and writing elisp is quite painful.

Org-mode seems to be written in elisp. We have to customize it with elisp. Elisp is too much hard to learn to just customize personal blog.

I gave up.


There are many frameworks to generate static blogs:

Some use these frameworks to export orgs.

They cover what I want to do. But I felt they are too much to build my small personal blog. Who wants to kick a web server to preview articles?


I love ruby and rails. This is simple and painless solution for me because ruby has many libraries to process texts and htmls.


Ruby has an erb template engine.

I inserted HTML files from org to templates. It is quite easy way.


Org-ruby is a library for ruby to parse and export orgs. I cant insert some ids and classes into generated HTML to customize apearances and behaviors while parsing org files.


These are conceptual pseudocode samples.

Erb templtes should be like this:

<html xmlns="" lang="en" xml:lang="en">
    <title>YOUR TITLE</title>
      <H1 class="title"> BLOG TITLE </H1>
    <article id="main-article">
      <%= @html %>

@html is a strings which contains html code. Ruby generate @html like this:

data =
@html =, { markup_file: "html.tags.yml" })
          .split("\n").map { |line|
             # processing
             line = some_process line


Finally, I’ve wrote blog form scratch. so I understand every inch of my scripts. If I want some features, I code. That’s simple. That’s how programmers should be.

I’ve not uploaded codes to github or any repositories. My blogging scripts quite dependent on my system. I have to generalize it to publish it.