summaryrefslogtreecommitdiff
path: root/posts/blog-architecture.md
diff options
context:
space:
mode:
Diffstat (limited to 'posts/blog-architecture.md')
-rw-r--r--posts/blog-architecture.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/posts/blog-architecture.md b/posts/blog-architecture.md
new file mode 100644
index 0000000..be969de
--- /dev/null
+++ b/posts/blog-architecture.md
@@ -0,0 +1,47 @@
1% General Architecture of this "Blogging" System
2
3The main idea behind this system is that my site is supposed to consist of
4*posts* which are organized into *lists of posts*. This mapping is not assumed
5to be injective, i.e. a post may be a member of many lists. In fact, this is how
6the list [All Posts](/lists/zz_all.html) is made: every post is supposed to be
7linked into it.
8
9To keep order in this mess of data, I have decided to map it into the file
10system. I have a folder `posts` which contains all posts and a folder `lists`
11with all the lists. Every list is a folder with symbolic links to posts:
12
13 blog
14 ├── lists
15 │ ├── all
16 │ │ ├── 001 -> ../../posts/hello-world.md
17 │ │ └── title
18 │ ├── blog
19 │ │ └── title
20 └── posts
21 └── hello-world.md
22
23As you can see, I have added a special file to each list folder named `title`
24which contains the title of the list (as you might have guessed).
25
26Posts are written as [Markdown](http://en.wikipedia.org/wiki/Markdown) files and
27converted to HTML with [Pandoc](http://en.wikipedia.org/wiki/Pandoc). Pandoc
28handles this conversion almost perfectly, but I had one small issue with
29it. Namely, I want to be able to write mathematics and hence translate
30TeX--snippets into something that your browser can display.
31
32Pandoc has several builtin methods to do this, but most of them either rely on a
33specialised TeX--parser or JavaScript. Both were deemed too ugly to use. So I
34wrote a filter around Pandoc to extract TeX-snippets and compile them with my
35regular LaTeX distribution into SVG. This seems to work quite nicely.
36
37The next issue was keeping this mess of posts and lists and Markdown files under
38control. Traditionally, I would have used a Makefile for that but I wanted
39something a little nicer this time. I turned to an old idea of
40[Dan Bernstein's](http://cr.yp.to/djb.html):
41[Redo](http://cr.yp.to/redo.html). There are several implementations of Redo out
42there; eventually I plan to write my own, just as practice. For now, I use a
43very minimal implementation in shell script from
44<https://github.com/apenwarr/redo>.
45
46More on how exactly the conversion from Markdown to HTML and all the associated
47ecosystem works will appear in a later post.