auto replace issue number and date

This commit is contained in:
Solene Rapenne 2021-09-26 23:53:43 +02:00
parent 9f0a0fdb78
commit 38a9e6a37c
3 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<div id="title">OpenBSD Webzine</div>
<div id="banner">
<span>ISSUE #1</span>
<span class="right">Sat Sep 25 12:06:17 UTC 2021</span>
<div>ISSUE #__ISSUE__</div>
<div>__DATE__</div>
</div>
<main>

View File

@ -1,6 +1,6 @@
<div id="title">OpenBSD Webzine</div>
<div id="banner">
<span>ISSUE #1</span>
<span class="right">Sat Sep 25 12:06:17 UTC 2021</span>
<div>ISSUE #__ISSUE__</div>
<div>__DATE__</div>
</div>
<main>

View File

@ -25,3 +25,10 @@ else
fi
cat _common/header $DIR/*html _common/footer > ../${DEST}/${DIR}.html
# replace with issue number
issue=$(echo -n "$1" | egrep -o "[0-9]+")
sed -i "s/__ISSUE__/${issue}/g" ../${DEST}/${DIR}.html
# replace date
sed -i "s/__DATE__/$(date -u)/" ../${DEST}/${DIR}.html