summaryrefslogtreecommitdiff
path: root/build_index.sh
blob: b2f36549a9cb5bd6cd394d95ed63e607eab44c2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env bash

build_index() {
  echo '<html><body>'
  echo '<ul>'
  for i in $(find generated/ -name '*.html'); do
    if [ "$i" == "generated/writing.html" ]; then
      continue
    fi
    real_path=${i#generated/}
    filename=${real_path##*/}
    title=${filename%.html}
    echo "<li><a href=\"$real_path\">$title</a></li>"
  done
  echo '</ul>'
  echo '</body></html>'
}

build_index > generated/writing.html