2026.camp.public.website/update-guide.sh

25 lines
No EOL
617 B
Bash
Executable file

#!/bin/bash
GUIDE_EDGEDOC_URL="https://md.lqdn.fr/H0gKhjbKTfeM41L9bG9zUA"
DATE_CMD="date --utc '+%d/%m/%Y %H:%I UTC'"
echo "Mise a jour du guide dans guide.html a partir du edgedoc"
echo "$GUIDE_EDGEDOC_URL"
set -e
curl --silent --fail-with-body "$GUIDE_EDGEDOC_URL/download" > guide.tmp.md
pandoc --from markdown --to html guide.tmp.md > guide.tmp.html
cat guide.template.html \
| sed '/EDGEDOC/{
s/<!-- *EDGEDOC[^-]*-->//;
r guide.tmp.html
}' \
| sed -e "/DATE/{
s/<!-- *DATE[^-]*-->//;
n;
e $DATE_CMD
}" \
> guide.html
rm guide.tmp.md guide.tmp.html