From f7d4ba2023ab18b9d7c5fad85cbb863c61e6272c Mon Sep 17 00:00:00 2001 From: Viktor Kleen Date: Fri, 2 Jan 2015 09:29:04 +0000 Subject: initial commit --- lists/default.md.do | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lists/default.md.do (limited to 'lists/default.md.do') 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 @@ +#!/usr/bin/env bash +redo-ifchange "$2/title" + +POSTS=() +while read -r -d $'\0'; do + post=$(realpath --relative-to=. "$REPLY") + POSTS+=("$post") +done < <(find "$2" -maxdepth 1 -mindepth 1 -not -name 'title' -print0 | sort -z) + +for x in "${POSTS[@]}"; do + printf "%s\0%s\0" "$x" "${x%.md}.html" +done | xargs -r -0 redo-ifchange + +TITLE=$(< $2/title) + +cat <&1 >/dev/null) + printf "* [%s](%s)\n" "$title" "${x%.md}.html" +done -- cgit v1.2.3