add default index
authorrick <rick@gnous.eu>
Fri, 13 Jan 2023 16:57:31 +0000 (17:57 +0100)
committerrick <rick@gnous.eu>
Fri, 13 Jan 2023 16:57:31 +0000 (17:57 +0100)
Dockerfile
generate.sh

index 9852570d620573d06fbb8ed6e195c4010ed23c03..bdaf0cdbb0aa593af860161936c06e4c7f2e2105 100644 (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
index 9802ba706909099f711376de4b3d338418241445..155b2777d58c9d9ee87c636614947c86891bdfc1 100755 (executable)
@@ -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