commit: 2352c15c58ad58190dbdc3f245f5a04cce2aa9e5
parent 9fa2b5768212fc6c71e307a7b9a7ccfe406fe937
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 19 Nov 2024 09:41:18 +0100
configure: add support for french articles
Diffstat:
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
@@ -2,6 +2,7 @@
# SPDX-FileCopyrightText: 2023 Haelwenn (lanodan) Monnier <contact+blog@hacktivis.me>
# SPDX-License-Identifier: MIT
templates_en="./templates/head.xml ./templates/en/nav.xsl ./templates/en/footer.shtml"
+templates_fr="./templates/head.xml ./templates/fr/nav.xsl ./templates/fr/footer.shtml"
cat >|config.ninja <<-EOF
# Generated by: $0 $@
@@ -12,13 +13,19 @@ rule gen_config
build config.ninja: gen_config configure | ./articles
build entry.xsl: xinclude entry.xsl.in | ${templates_en}
+build entrée.xsl: xinclude entrée.xsl.in | ${templates_fr}
build bookmarks.xsl: xinclude bookmarks.xsl.in | ${templates_en}
build nginx_autoindex.xsl: xinclude nginx_autoindex.xsl.in | ${templates_en}
EOF
-for i in articles/*.xml
+for file in articles/*.xml
do
- i="${i//$/\$\$}" # '$' → '$$'
+ i="${file//$/\$\$}" # '$' → '$$'
i="${i// /$ }" # ' ' → '$ '
- echo "build ${i//.xml/.html}: article entry.xsl ${i}"
+
+ if grep -q -F 'xml:lang="fr"' "$file"; then
+ echo "build ${i//.xml/.html}: article entrée.xsl ${i}"
+ else
+ echo "build ${i//.xml/.html}: article entry.xsl ${i}"
+ fi
done >>config.ninja