From 9a53a6914b541a79c703b5f67111fe8e3fe497c6 Mon Sep 17 00:00:00 2001 From: rick <rick@gnous.eu> Date: Thu, 4 Apr 2024 21:29:29 +0200 Subject: [PATCH 1/2] use iso norm instead of flags for languages --- css/style.css | 17 ++++++++++------- generate.sh | 2 +- header.html | 4 ++-- img/en.svg | 9 --------- img/fr.svg | 6 ------ lang/en/about.html | 8 -------- lang/en/index.html | 1 + lang/fr/apropos.html | 8 -------- lang/fr/index.html | 1 + 9 files changed, 15 insertions(+), 41 deletions(-) delete mode 100644 img/en.svg delete mode 100644 img/fr.svg diff --git a/css/style.css b/css/style.css index eaaf81f..c40144e 100644 --- a/css/style.css +++ b/css/style.css @@ -35,20 +35,23 @@ header h2 { #lang { margin-top: 20px; + display: grid; + grid-auto-flow: column; + grid-column-gap: 1em; + grid-template-rows: fit-content(100%); } -#lang img { - border: 2px solid black; - filter: brightness(50%); +#lang a { + font-weight: bold; + font-size: 150%; } #lang #choose { - filter: brightness(100%); + color: #4970E1; } -#lang img:hover { - filter: brightness(100%); - border-color: cyan; +#lang a:hover { + color: #FA4DBA; } #header-links { diff --git a/generate.sh b/generate.sh index c6aed7b..a940a6f 100755 --- a/generate.sh +++ b/generate.sh @@ -179,7 +179,7 @@ do sed -i -e "/%links%/d" $file sed -i -e "/%link%/,/%endlink%/d" $file - sed -i -e "s/img alt=\"$l/img id=\"choose\" alt=\"$l/" $file + sed -i -e "s/>${l^^}<\/a>/ id=\"choose\">${l^^}<\/a>/" $file sed -i -e "s/%file%/$i/" $file sed -i -e "s/%gitfile%/lang\/$l\/$i/" $file diff --git a/header.html b/header.html index 6b00e9e..78cf5d3 100644 --- a/header.html +++ b/header.html @@ -17,8 +17,8 @@ <h2>%subtitle%</h2> </div> <div id="lang"> - <a href="/fr/%file%"><img alt="fr" src="/img/fr.svg" height=35 /></a> - <a href="/en/%file%"><img alt="en" src="/img/en.svg" height=35 /></a> + <a href="/fr/%file%">FR</a> + <a href="/en/%file%">EN</a> <!--<a href="/toki/%file%"><img alt="toki" src="/img/fr.svg" height=35 /></a>--> </div> </header> diff --git a/img/en.svg b/img/en.svg deleted file mode 100644 index 75b969d..0000000 --- a/img/en.svg +++ /dev/null @@ -1,9 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 30" width="1000" height="600"> - <clipPath id="t"> - <path d="M25,15h25v15zv15h-25zh-25v-15zv-15h25z"/> - </clipPath> - <path d="M0,0v30h50v-30z" fill="#012169"/> - <path d="M0,0 50,30M50,0 0,30" stroke="#fff" stroke-width="6"/> - <path d="M0,0 50,30M50,0 0,30" clip-path="url(#t)" stroke="#C8102E" stroke-width="4"/> - <path d="M-1 11h22v-12h8v12h22v8h-22v12h-8v-12h-22z" fill="#C8102E" stroke="#FFF" stroke-width="2"/> -</svg> \ No newline at end of file diff --git a/img/fr.svg b/img/fr.svg deleted file mode 100644 index 3165e37..0000000 --- a/img/fr.svg +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600"> -<rect width="900" height="600" fill="#CE1126"/> -<rect width="600" height="600" fill="#FFFFFF"/> -<rect width="300" height="600" fill="#002654"/> -</svg> diff --git a/lang/en/about.html b/lang/en/about.html index 867e1cc..17b2693 100644 --- a/lang/en/about.html +++ b/lang/en/about.html @@ -10,14 +10,6 @@ <h2>Header</h2> <p>The Glider comes from <a href="http://www.catb.org/hacker-emblem/">catb website</a>.</p> - <h3>Flags</h3> - <p>I use SVGs from Wikipedia.</p> - - <ul> - <li><a href="https://en.wikipedia.org/wiki/File:Flag_of_France.svg">France</a></li> - <li><a href="https://en.wikipedia.org/wiki/File:Flag_of_the_United_Kingdom_(1-2).svg">United-Kingdom</a></li> - </ul> - <h2>Web buttons in footer</h2> <p>The links on the buttons are often websites where I found them.</p> diff --git a/lang/en/index.html b/lang/en/index.html index fc151ef..5d3869e 100644 --- a/lang/en/index.html +++ b/lang/en/index.html @@ -24,6 +24,7 @@ rel="stylesheet" href="/css/index.css" <h2>News</h2> <p>I'll add the interesting news of my website here. Read the commits to have more informations about the small changes of the site !</p> <div id="news"> + <p><code>04-04-2024:</code> use ISO norm instead of flags for languages.</p> <p><code>25-10-2023:</code> translate everything \o/ (unless ??).</p> <p><code>04-10-2023:</code> moving to a VPS at <a href="https://contabo.com">Contabo</a>.</p> <p><code>29-09-2023:</code> nice favicon :).</p> diff --git a/lang/fr/apropos.html b/lang/fr/apropos.html index 56011eb..f51289d 100644 --- a/lang/fr/apropos.html +++ b/lang/fr/apropos.html @@ -10,14 +10,6 @@ <h2>Header</h2> <p>Le Glider vient du site de <a href="http://www.catb.org/hacker-emblem/">catb</a>.</p> - <h3>Drapeaux des langues</h3> - <p>Ils proviennent des fichiers SVG de Wikipedia.</p> - - <ul> - <li><a href="https://en.wikipedia.org/wiki/File:Flag_of_France.svg">France</a></li> - <li><a href="https://en.wikipedia.org/wiki/File:Flag_of_the_United_Kingdom_(1-2).svg">Royaume-Uni</a></li> - </ul> - <h2>Boutons web dans le footer</h2> <p>Les liens des boutons sont souvent les sites sur lesquels j'ai pu trouver les boutons.</p> diff --git a/lang/fr/index.html b/lang/fr/index.html index c73b1c6..5e514f2 100644 --- a/lang/fr/index.html +++ b/lang/fr/index.html @@ -24,6 +24,7 @@ rel="stylesheet" href="/css/index.css" <h2>Nouveautés</h2> <p>Je rajouterai les nouveautés intéressantes du site ici. Lisez les commits pour avoir plus de détails sur les petites modifications du site !</p> <div id="news"> + <p><code>04-04-2024:</code> utilisation de la norme ISO au lieu de drapeaux pour les langues.</p> <p><code>04-10-2023:</code> migration vers un VPS chez <a href="https://contabo.com">Contabo</a>.</p> <p><code>29-09-2023:</code> un joli favicon :).</p> <p><code>30-05-2023:</code> une meilleure CSP pour éviter <a href="https://im-in.space/@kdy/110429056346185564">les injections de trackers</a>.</p> From 554d9383bcf111b5b9d42fb7b315bffff79231c1 Mon Sep 17 00:00:00 2001 From: rick <rick@gnous.eu> Date: Thu, 4 Apr 2024 21:31:00 +0200 Subject: [PATCH 2/2] better args parsing for docker --- generate.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/generate.sh b/generate.sh index a940a6f..6eabcf9 100755 --- a/generate.sh +++ b/generate.sh @@ -31,6 +31,7 @@ defaultLang="fr" header="header.html" footer="footer.html" org=0 +testDocker=0 ################################################################################ # Génère un message d'aide @@ -78,14 +79,7 @@ do exit 0 ;; "-t") # lancer un docker de test - docker build . --tag site && echo -e \ - "\n\033[32mSite de test déployé sur l'adresse" \ - "localhost:8080\033[0m" || exit 1 - echo -e "\033[32mC-c pour quitter\033[0m\n" - - docker run --rm -p 8080:80 site - docker rmi site - exit 0 + testDocker=1 ;; "-d") ;& "-n") @@ -133,6 +127,22 @@ function generate_header { echo -e " </div>\n" >> $tmpHeader } + + + + +if [ $testDocker -eq 1 ] +then + docker build . --tag site && echo -e \ + "\n\033[32mSite de test déployé sur l'adresse" \ + "localhost:8080\033[0m" || exit 1 + echo -e "\033[32mC-c pour quitter\033[0m\n" + + docker run --rm -p 8080:80 site + docker rmi site + exit 0 +fi + if [ -d $target ] then # TODO demander à l'utilisateur