add default index

This commit is contained in:
rick 2023-01-13 17:57:31 +01:00
parent 439bbd1258
commit 6544c009e2
Signed by: Rick
GPG key ID: 4A6223D66294EB20
2 changed files with 22 additions and 2 deletions

View file

@ -10,5 +10,5 @@ COPY footer.html .
RUN ./generate.sh -o
COPY www /usr/share/nginx/html
COPY www/ /usr/share/nginx/html/
EXPOSE 80

View file

@ -150,11 +150,31 @@ do
sed -i -e "s/%file%/$i/" $file
sed -i -e "s/%lang%/$l/" $file
done
done
echo "Copy $annexes in $target..."
cp -t $target -r $annexes
echo "Generate default index page..."
cp $target/$defaultLang/index.html $target
for c in $(awk 'BEGIN {
FS = "\n";
code = 0
}
{
if ($0 ~ /id="header-links"/) {
code = 1
next
} else if ($0 ~ /\/div/) {
code = 0
} if (code) {
print NR
}
}' www/index.html)
do
sed -i -e "$c s/href=\"/href=\"$defaultLang\//" $target/index.html
done
echo "Link Links (lul)"
ln -s $pathLinks $target