aboutsummaryrefslogtreecommitdiff
path: root/gen/gen_index.sh
blob: a9bcaf1a79e37145ed42d5463fc6a1d8924d2619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash

echo -e "---\ntitle: All Stories\n---\n"

echo "You can also see the stories sorted by life lessons [here](life_lessons.html)"
echo

for i in $(find md -maxdepth 1 -name "*.md" -printf '%f\n'); do
  (
    title=$(sed -n 's/^title: //p' "md/$i")
    filename="${i%.*}"
    nr="${filename%%_*}"
    printf "%s. [$title](stories/${filename}.html)\n" "${filename%%_*}"
  ) &
done | sort -n