add multilang support

This commit is contained in:
Solene Rapenne 2022-03-15 19:53:57 +01:00
parent fffcee44aa
commit fe1c9d53e7
1 changed files with 9 additions and 4 deletions

View File

@ -22,9 +22,14 @@ DIR=$(basename $1)
DESTFILENAME=$2
CURINODE=$(stat -f "%i" current/)
LNSFX=""
if [ -n "$LN" ]; then
LNSFX="${LN}_"
fi
test -d "$DIR" || usage
test -d ../public/ || die "You must run this from openbsd-webzine/current"
ls $DIR/*.html 2>&1 >/dev/null || die "no html file in $DIR"
ls $DIR/${LNSFX}*.html 2>&1 >/dev/null || die "no ${LN} html file in $DIR"
. ./${DIR}/metadata.sh
@ -37,10 +42,10 @@ fi
if test -z "$DESTFILENAME"
then
DESTFILENAME="../${DEST}/${DIR}.html"
DESTFILENAME="../${DEST}/${LNSFX}${DIR}.html"
fi
cat _common/header $DIR/*html _common/footer > $DESTFILENAME
cat _common/header $DIR/${LNSFX}*html _common/footer > $DESTFILENAME
if echo $DIR | grep issue
then
@ -65,6 +70,6 @@ else
# index.html changes
sed -i "s/ #__ISSUE__//g" $DESTFILENAME
sed -i "s/__TITLE__/homepage/g" $DESTFILENAME
sed -i "s/__FILENAME__/index.html/" $DESTFILENAME
sed -i "s/__FILENAME__/${LNSFX}index.html/" $DESTFILENAME
fi