diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-08-03 17:43:40 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-08-03 17:43:40 +0200 |
commit | 52b67951f1e8a7f1af9b85d4ae8e7689d194574a (patch) | |
tree | 88076113c7020e8483e5f47afa618d6449034f7e /lists | |
parent | 230688a0b842cf57b316a7ba62910ca387afbce7 (diff) | |
download | dirty-haskell.org-52b67951f1e8a7f1af9b85d4ae8e7689d194574a.tar dirty-haskell.org-52b67951f1e8a7f1af9b85d4ae8e7689d194574a.tar.gz dirty-haskell.org-52b67951f1e8a7f1af9b85d4ae8e7689d194574a.tar.bz2 dirty-haskell.org-52b67951f1e8a7f1af9b85d4ae8e7689d194574a.tar.xz dirty-haskell.org-52b67951f1e8a7f1af9b85d4ae8e7689d194574a.zip |
Working prototype in hakyll
Diffstat (limited to 'lists')
-rw-r--r-- | lists/default.md.do | 41 | ||||
l--------- | lists/dirty-haskell/001 | 1 | ||||
l--------- | lists/dirty-haskell/002 | 1 | ||||
-rw-r--r-- | lists/dirty-haskell/title | 1 | ||||
l--------- | lists/zz_all/001 | 1 | ||||
l--------- | lists/zz_all/002 | 1 | ||||
l--------- | lists/zz_all/003 | 1 | ||||
-rw-r--r-- | lists/zz_all/title | 1 |
8 files changed, 0 insertions, 48 deletions
diff --git a/lists/default.md.do b/lists/default.md.do deleted file mode 100644 index 55abe6f..0000000 --- a/lists/default.md.do +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | redo-ifchange "$2/title" | ||
3 | |||
4 | POSTS=() | ||
5 | while read -r -d $'\0'; do | ||
6 | post=$(realpath --relative-to=. "$REPLY") | ||
7 | POSTS+=("$post") | ||
8 | done < <(find "$2" -maxdepth 1 -mindepth 1 -not -name 'title' -not -name 'preview' -print0 | sort -z) | ||
9 | |||
10 | for x in "${POSTS[@]}"; do | ||
11 | printf "%s\0%s\0" "$x" "${x%.md}.html" | ||
12 | done | xargs -r -0 redo-ifchange | ||
13 | |||
14 | TITLE=$(< $2/title) | ||
15 | |||
16 | cat <<EOF | ||
17 | % $(< "$2/title") | ||
18 | |||
19 | EOF | ||
20 | |||
21 | POST_TITLES=() | ||
22 | for x in "${POSTS[@]}"; do | ||
23 | title=$(pandoc -t json "$x" | ../build/extract-title.hs) | ||
24 | POST_TITLES+=("$title") | ||
25 | done | ||
26 | |||
27 | for n in $(seq 0 $((${#POSTS[@]}-1))); do | ||
28 | printf "* [%s](%s)\n" "${POST_TITLES[$n]}" "${POSTS[$n]%.md}.html" | ||
29 | done | ||
30 | |||
31 | >"$2/preview" | ||
32 | prev_no=3 | ||
33 | if [[ ${#POSTS[@]} -gt $prev_no ]]; then | ||
34 | printf "* …\n" >> "$2/preview" | ||
35 | else | ||
36 | prev_no=${#POSTS[@]} | ||
37 | fi | ||
38 | |||
39 | for n in $(seq $prev_no -1 1); do | ||
40 | printf "* [%s](%s)\n" "${POST_TITLES[-$n]}" "${POSTS[-$n]%.md}.html" >>"$2/preview" | ||
41 | done | ||
diff --git a/lists/dirty-haskell/001 b/lists/dirty-haskell/001 deleted file mode 120000 index 92c240d..0000000 --- a/lists/dirty-haskell/001 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | ../../posts/blog-documentation.md \ No newline at end of file | ||
diff --git a/lists/dirty-haskell/002 b/lists/dirty-haskell/002 deleted file mode 120000 index ed24126..0000000 --- a/lists/dirty-haskell/002 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | ../../posts/blog-rss.md \ No newline at end of file | ||
diff --git a/lists/dirty-haskell/title b/lists/dirty-haskell/title deleted file mode 100644 index e40f49c..0000000 --- a/lists/dirty-haskell/title +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | Blog Software | ||
diff --git a/lists/zz_all/001 b/lists/zz_all/001 deleted file mode 120000 index 92c240d..0000000 --- a/lists/zz_all/001 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | ../../posts/blog-documentation.md \ No newline at end of file | ||
diff --git a/lists/zz_all/002 b/lists/zz_all/002 deleted file mode 120000 index ed24126..0000000 --- a/lists/zz_all/002 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | ../../posts/blog-rss.md \ No newline at end of file | ||
diff --git a/lists/zz_all/003 b/lists/zz_all/003 deleted file mode 120000 index 1057f2c..0000000 --- a/lists/zz_all/003 +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | ../../posts/pwutil.md \ No newline at end of file | ||
diff --git a/lists/zz_all/title b/lists/zz_all/title deleted file mode 100644 index 73a5267..0000000 --- a/lists/zz_all/title +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | All Posts | ||