summaryrefslogtreecommitdiff
path: root/make_site_index.sh
blob: f2c758f90a4a1e2540a3e43dc6816872118aeda5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

SPECVERSION=$1
SITE=_site
VERSIONS=`cd $SITE; ls -d -1 0.* | sort -r -g`

echo "% CommonMark Spec\n"
echo "[**Latest version ($SPECVERSION)**](/$SPECVERSION/)\n"
echo "Older versions:\n"
for vers in $VERSIONS
  do
    if [ "$vers" != "$SPECVERSION" ]; then
	perl -p -i -e 's/<div id="watermark">.*?<\/div>/<div id="watermark" style="background-color:black">This is an older version of the spec. For the most recent version, see <a href="http:\/\/spec.commonmark.org">http:\/\/spec.commonmark.org<\/a>.<\/div>/' $SITE/$vers/index.html
        echo "- [$vers](/$vers/)"
    fi
  done