summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Kleen <viktor@kleen.org>2015-01-07 16:42:28 +0000
committerViktor Kleen <viktor@kleen.org>2015-01-07 16:42:28 +0000
commit88ee48c053f996679983f9fdbe806f7a15b41c4d (patch)
treefef8fa03a985f45e91ecac4e6025fc95663d9217
parentc4eb2e17d6d89def1c012c9719879e2f0cea786f (diff)
downloaddirty-haskell.org-88ee48c053f996679983f9fdbe806f7a15b41c4d.tar
dirty-haskell.org-88ee48c053f996679983f9fdbe806f7a15b41c4d.tar.gz
dirty-haskell.org-88ee48c053f996679983f9fdbe806f7a15b41c4d.tar.bz2
dirty-haskell.org-88ee48c053f996679983f9fdbe806f7a15b41c4d.tar.xz
dirty-haskell.org-88ee48c053f996679983f9fdbe806f7a15b41c4d.zip
Post blog architecture
-rw-r--r--index.md.do2
l---------lists/blog/0011
-rw-r--r--lists/blog/title1
-rw-r--r--lists/default.md.do5
l---------lists/zz_all/001 (renamed from lists/all/001)0
l---------lists/zz_all/0021
-rw-r--r--lists/zz_all/title (renamed from lists/all/title)0
-rw-r--r--posts/blog-architecture.md47
-rw-r--r--style.css2
9 files changed, 55 insertions, 4 deletions
diff --git a/index.md.do b/index.md.do
index 933b1a8..e36b596 100644
--- a/index.md.do
+++ b/index.md.do
@@ -33,6 +33,6 @@ EOF
33for x in "${LISTS[@]}"; do 33for x in "${LISTS[@]}"; do
34 printf "* [%s](%s)\n" "$(<$x/title)" "$x.html" 34 printf "* [%s](%s)\n" "$(<$x/title)" "$x.html"
35 while read -r -d $'\n'; do 35 while read -r -d $'\n'; do
36 printf " %s" "$REPLY" 36 printf " %s\n" "$REPLY"
37 done < "$x/preview" 37 done < "$x/preview"
38done 38done
diff --git a/lists/blog/001 b/lists/blog/001
new file mode 120000
index 0000000..0583396
--- /dev/null
+++ b/lists/blog/001
@@ -0,0 +1 @@
../../posts/blog-architecture.md \ No newline at end of file
diff --git a/lists/blog/title b/lists/blog/title
new file mode 100644
index 0000000..657adaa
--- /dev/null
+++ b/lists/blog/title
@@ -0,0 +1 @@
"Blog" Documentation
diff --git a/lists/default.md.do b/lists/default.md.do
index daf7453..fffd6e2 100644
--- a/lists/default.md.do
+++ b/lists/default.md.do
@@ -28,13 +28,14 @@ for n in $(seq 0 $((${#POSTS[@]}-1))); do
28 printf "* [%s](%s)\n" "${POST_TITLES[$n]}" "${POSTS[$n]%.md}.html" 28 printf "* [%s](%s)\n" "${POST_TITLES[$n]}" "${POSTS[$n]%.md}.html"
29done 29done
30 30
31>"$2/preview"
31prev_no=3 32prev_no=3
32if [[ ${#POSTS[@]} -gt $prev_no ]]; then 33if [[ ${#POSTS[@]} -gt $prev_no ]]; then
33 printf "* …\n" > "$2/preview" 34 printf "* …\n" >> "$2/preview"
34else 35else
35 prev_no=${#POSTS[@]} 36 prev_no=${#POSTS[@]}
36fi 37fi
37 38
38for n in $(seq $prev_no -1 1); do 39for n in $(seq $prev_no -1 1); do
39 printf "* [%s](%s)\n" "${POST_TITLES[-$n]}" "${POSTS[-$n]%.md}.html" >"$2/preview" 40 printf "* [%s](%s)\n" "${POST_TITLES[-$n]}" "${POSTS[-$n]%.md}.html" >>"$2/preview"
40done 41done
diff --git a/lists/all/001 b/lists/zz_all/001
index 659bc10..659bc10 120000
--- a/lists/all/001
+++ b/lists/zz_all/001
diff --git a/lists/zz_all/002 b/lists/zz_all/002
new file mode 120000
index 0000000..0583396
--- /dev/null
+++ b/lists/zz_all/002
@@ -0,0 +1 @@
../../posts/blog-architecture.md \ No newline at end of file
diff --git a/lists/all/title b/lists/zz_all/title
index 73a5267..73a5267 100644
--- a/lists/all/title
+++ b/lists/zz_all/title
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.
diff --git a/style.css b/style.css
index 7158c52..ef9e2a5 100644
--- a/style.css
+++ b/style.css
@@ -2,7 +2,7 @@ body {
2 margin: auto; 2 margin: auto;
3 padding-right: 1em; 3 padding-right: 1em;
4 padding-left: 1em; 4 padding-left: 1em;
5 font: normal 1.1em/1.3em monospace; 5 font: normal 1.1em monospace;
6 max-width: 60em; 6 max-width: 60em;
7 text-align: justify; 7 text-align: justify;
8} 8}