summaryrefslogtreecommitdiff
path: root/fix-website.sh
blob: 7261ee5ddf79236dd841a661d591a69660ffedcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/bash

set -eu
shopt -s nullglob

cd "doc/manual/html_node"
destdir="../html"

rm -rf "$destdir"
mkdir -p "$destdir"

for n in *.html; do
  echo fixing "$n"
  case "$n" in
    index.html)
      m="autoconf-archive.html"
      ;;
    *)
      m="${n//_005f/_}"
      ;;
  esac
  sed <"$n" >"$destdir/$m" \
    -e 's|_005f|_|g' \
    -e 's|href="index.html|href="autoconf-archive.html|g' \
    -e 's|href="../index.html|href="index.html|g'
done