diff options
Diffstat (limited to 'lists')
l--------- | lists/all/001 | 1 | ||||
l--------- | lists/all/002 | 1 | ||||
l--------- | lists/all/003 | 1 | ||||
-rw-r--r-- | lists/all/title | 1 | ||||
-rw-r--r-- | lists/default.md.do | 24 | ||||
l--------- | lists/stuff/001 | 1 | ||||
l--------- | lists/stuff/002 | 1 | ||||
-rw-r--r-- | lists/stuff/title | 1 |
8 files changed, 31 insertions, 0 deletions
diff --git a/lists/all/001 b/lists/all/001 new file mode 120000 index 0000000..1ce79c6 --- /dev/null +++ b/lists/all/001 | |||
@@ -0,0 +1 @@ | |||
../../posts/blub.md \ No newline at end of file | |||
diff --git a/lists/all/002 b/lists/all/002 new file mode 120000 index 0000000..1ca4d2f --- /dev/null +++ b/lists/all/002 | |||
@@ -0,0 +1 @@ | |||
../../posts/blub2.md \ No newline at end of file | |||
diff --git a/lists/all/003 b/lists/all/003 new file mode 120000 index 0000000..5df958a --- /dev/null +++ b/lists/all/003 | |||
@@ -0,0 +1 @@ | |||
../../posts/blub3.md \ No newline at end of file | |||
diff --git a/lists/all/title b/lists/all/title new file mode 100644 index 0000000..73a5267 --- /dev/null +++ b/lists/all/title | |||
@@ -0,0 +1 @@ | |||
All Posts | |||
diff --git a/lists/default.md.do b/lists/default.md.do new file mode 100644 index 0000000..94636df --- /dev/null +++ b/lists/default.md.do | |||
@@ -0,0 +1,24 @@ | |||
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' -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 | for x in "${POSTS[@]}"; do | ||
22 | title=$(pandoc -t json "$x" | ../build/extract-title.hs 2>&1 >/dev/null) | ||
23 | printf "* [%s](%s)\n" "$title" "${x%.md}.html" | ||
24 | done | ||
diff --git a/lists/stuff/001 b/lists/stuff/001 new file mode 120000 index 0000000..1ce79c6 --- /dev/null +++ b/lists/stuff/001 | |||
@@ -0,0 +1 @@ | |||
../../posts/blub.md \ No newline at end of file | |||
diff --git a/lists/stuff/002 b/lists/stuff/002 new file mode 120000 index 0000000..5df958a --- /dev/null +++ b/lists/stuff/002 | |||
@@ -0,0 +1 @@ | |||
../../posts/blub3.md \ No newline at end of file | |||
diff --git a/lists/stuff/title b/lists/stuff/title new file mode 100644 index 0000000..9d43527 --- /dev/null +++ b/lists/stuff/title | |||
@@ -0,0 +1 @@ | |||
Stuff | |||