diff --git a/bin/check.sh b/bin/check.sh index 5623aea214c850e54790858d84d6aac9ecbfb362..3d357594412fab1c5f6611639fb2042ee151979e 100755 --- a/bin/check.sh +++ b/bin/check.sh @@ -25,7 +25,7 @@ if [ ! -d $INPUT_DIR ]; then fi echo_bold_green "- Checking links in $INPUT_DIR..." -$BIN_DIR/lychee --offline $INPUT_DIR +$BIN_DIR/lychee --offline --exclude '.*/app$' $INPUT_DIR if [ $? -ne 0 ]; then echo_bold_red "Errors were found" exit 1 diff --git a/bin/deploy.sh b/bin/deploy.sh index e53c11413d68b3a56ab490d98c4400c18d5d8245..2f4dcd027b6447935b17235c7eb61d79cc7ccacd 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -76,7 +76,7 @@ echo_bold_green "- Launching Hugo server..." hugo server & sleep 1 echo_bold_green "- Checking links..." -bin/lychee http://localhost:1313/ +bin/lychee --exclude '.*/app$' http://localhost:1313/ if [ $? -ne 0 ]; then echo_bold_red "Errors were found" pkill hugo diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 9787d84f7079cc2ddfdebcab07d87b53e3fc478a..6d9d819f860de83d8ebb17ce5955ed8ebe87c563 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -47,6 +47,7 @@ France""" [languages] [languages.en] landingPageName = "<i class='fas fa-home'></i> Home" + license = "Unless otherwise stated, all text on this site is licensed under the <a href=\"https://www.etalab.gouv.fr/licence-ouverte-open-licence/\" target=\"_blank\">etalab-2.0 licence</a>." [[languages.en.menu.shortcuts]] name = "Cookies" @@ -83,9 +84,16 @@ France""" url = "../contact.html" weight = 7 + [[languages.en.menu.toplinks]] + name = "Interactive map" + url = "../app/" + weight = 1 + [languages.fr] landingPageName = "<i class='fas fa-home'></i> Accueil" languageCode = "fr-fr" + license = "Sauf mention contraire, tous les textes de ce site sont sous <a href=\"https://www.etalab.gouv.fr/licence-ouverte-open-licence/\" target=\"_blank\">licence etalab-2.0</a>." + toggleTheme = "Changer de thème" [[languages.fr.menu.shortcuts]] name = "Cookies" @@ -121,3 +129,28 @@ France""" name = "Contactez-nous" url = "/contact.html" weight = 7 + + [[languages.fr.menu.toplinks]] + name = "Découvrir" + url = "/decouvrir.html" + weight = 1 + + [[languages.fr.menu.toplinks]] + name = "Guides" + url = "/guides.html" + weight = 2 + + [[languages.fr.menu.toplinks]] + name = "Références" + url = "/references.html" + weight = 3 + + [[languages.fr.menu.toplinks]] + name = "Explications" + url = "/Explications.html" + weight = 4 + + [[languages.fr.menu.toplinks]] + name = "Carte interactive" + url = "/app/" + weight = 5 diff --git a/content/_index.en.md b/content/_index.en.md new file mode 100644 index 0000000000000000000000000000000000000000..eac8cec67ecbe51a29f1df710513564c067a9ca9 --- /dev/null +++ b/content/_index.en.md @@ -0,0 +1,12 @@ +--- +title: Home +date: 2023-12-12 +lastmod: 2023-12-12 +description: AgroMetInfo home page - provision of agroclimatic indicators and indicators for monitoring winter crops (soft wheat) and spring crops (maize) using the STICS model in real time in the form of maps and graphs. +type: home +layout: index +--- + +AgroMetInfo documentation is [in French](../). + +<div class="app"><a href="{{< agrometinfoAppUrl >}}" role="button"><span class="fas fa-map"></span> Browse our interactive map</a></div> diff --git a/content/_index.md b/content/_index.md index c5ddd22bee4e52f72664d6f54a0bb05276190e9d..fe918f324cca326f93d04bfb0549e93a2d8127a8 100644 --- a/content/_index.md +++ b/content/_index.md @@ -3,23 +3,23 @@ title: Accueil date: 2023-09-12 lastmod: 2023-09-12 description: Page d’accueil d’AgroMetInfo - mise à disposition d’indicateurs agroclimatiques et des indicateurs de suivi de culture d’hiver (culture type blé tendre) et de printemps (culture type maïs) par le modèle STICS en temps réel sous forme de cartes et de graphiques. -archetype: home -hideDocumentTime: true -hideSidebar: true -hideTopbar: true +type: home +layout: index --- -## Qu’est-ce qu’AgroMetInfo ? +## Qu’est-ce qu’AgroMetInfo ? -AgroMetInfo met à disposition des indicateurs agroclimatiques et des indicateurs de suivi de culture d’hiver (culture type blé tendre) et de printemps (culture type maïs) par le modèle STICS en temps réel sous forme de cartes et de graphiques. Ils sont calculés à partir des variables climatiques issues de la réanalyse SAFRAN produite chaque jour par Météo-France (mailles de 8x8km de résolution sur le territoire métropolitiain et la Corse). Toutefois, AgroMetInfo n’utilise que les mailles dont l’altitude moyenne est inférieure à 800 mètres. Ainsi, AgroMetInfo fournit deux types d’éléments, à partir de deux démarches : -- la première caractérise les conditions agroclimatiques en « temps réel » à partir d’indicateurs usuels de type somme des températures, évolution d’un bilan hydrique simplifié, cumul des précipitations, -- la seconde la simulation par STICS d’une culture de blé tendre et de maïs sur la base d’une agriculture « simplifiée » (panel limité d’itinéraires techniques, de conditions variétales, de types de sols.). Les résultats produits sont des indicateurs permettant de caractériser des conditions agroclimatiques de l’année en cours et de les comparer à des conditions passées. +AgroMetInfo met à disposition des indicateurs agroclimatiques et des indicateurs de suivi de culture d’hiver (culture type blé tendre) et de printemps (culture type maïs) par le modèle STICS en temps réel sous forme de cartes et de graphiques. Ils sont calculés à partir des variables climatiques issues de la réanalyse SAFRAN produite chaque jour par Météo-France (mailles de 8x8km de résolution sur le territoire métropolitiain et la Corse). Toutefois, AgroMetInfo n’utilise que les mailles dont l’altitude moyenne est inférieure à 800 mètres. Ainsi, AgroMetInfo fournit deux types d’éléments, à partir de deux démarches : +- la première caractérise les conditions agroclimatiques en « temps réel » à partir d’indicateurs usuels de type somme des températures, évolution d’un bilan hydrique simplifié, cumul des précipitations, +- la seconde la simulation par STICS d’une culture de blé tendre et de maïs sur la base d’une agriculture « simplifiée » (panel limité d’itinéraires techniques, de conditions variétales, de types de sols). Les résultats produits sont des indicateurs permettant de caractériser des conditions agroclimatiques de l’année en cours et de les comparer à des conditions passées. Cette application est portée par l’unité de service [AgroClim](http://www6.paca.inrae.fr/agroclim/). -## Comment se retrouver dans ces pages ? +<div class="app"><a href="{{< agrometinfoAppUrl >}}" role="button"><span class="fas fa-map"></span> Découvrir notre carte interactive</a></div> -La documentation est structurée en 4 parties : +## Comment se retrouver dans ces pages ? + +La documentation est structurée en 4 parties : * [Découvrir AgroMetInfo](decouvrir.html) vous guide dans la prise en main de l’application, * [Guides pratiques](guides.html) présente des cas concrets d’utilisation, diff --git a/themes/hugo-theme-relearn/layouts/home/index.html b/themes/hugo-theme-relearn/layouts/home/index.html new file mode 100644 index 0000000000000000000000000000000000000000..826359c55ff03248789a50aa2601d2352823b5cf --- /dev/null +++ b/themes/hugo-theme-relearn/layouts/home/index.html @@ -0,0 +1,96 @@ +{{- $assetBusting := not .Site.Params.disableAssetsBusting }} +{{- $page := . }} +{{- $themevariants := slice | append (.Site.Params.themeVariant | default "auto" ) }} +<!DOCTYPE html> +<html lang="{{ .Page.Language | default " en" }}" dir="{{ T " Reading-direction" | default "ltr" }}"> +<head> + {{- partial "meta.html" . }} + <link href="{{"css/fontawesome-all.min.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"> + <link href="{{"css/home.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet"> + <link href="{{"css/fonts.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"> + <title>{{ .Page.Title }}</title> + <base href="{{ .Site.BaseURL }}"> + {{- partialCached "favicon.html" . }} + <script> + const baseUriFull='{{ trim .Site.BaseURL "/" | safeJS }}/'; + const localStorageThemeKey = baseUriFull + 'variant'; + function setTheme(theme) { + document.documentElement.setAttribute("data-theme", theme); + localStorage.setItem(localStorageThemeKey, "zen-" + theme); + var classes = "fas fa-toggle-on"; + if (theme == "dark") { + classes = "fas fa-toggle-off"; + } + var elem = document.getElementById("toggle-theme").className = classes; + } + function getTheme() { + //default to light + var theme = "light"; + //local storage is used to override OS theme settings + if (localStorage.getItem(localStorageThemeKey)) { + if (localStorage.getItem(localStorageThemeKey) == "zen-dark") { + theme = "dark"; + } + } else if (document.documentElement.getAttribute("data-theme")) { + if (document.documentElement.getAttribute("data-theme") == "dark") { + theme = "dark"; + } + } else if(window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) { + //OS theme setting detected as dark + theme = "dark"; + } + return theme; + } + function toggleTheme() { + const theme = getTheme(); + if (theme === 'dark') { + setTheme('light'); + } else { + setTheme('dark'); + } + } + setTheme(getTheme()); + </script> +</head> +<body> + <nav> + {{- partial "agroclimapps.html" }} + <ul> + <li class="brand"> + <img alt="logo" src="{{ "images/logo_etat-agrometinfo.svg" | relURL }}" /> + </li> + {{- with .Site.Menus.toplinks }} + {{- range sort . "Weight" }} + {{- $shortcut := . }} + {{- with $page.Site.GetPage (printf "%s" $shortcut.URL ) }} + {{- $to := . }} + <li>{{ $shortcut.Pre }}<a class="padding" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ safeHTML $shortcut.Name }}</a>{{ $shortcut.Post }}</li> + {{- else }} + <li>{{ $shortcut.Pre }}<a class="padding" href="{{ $shortcut.URL | relLangURL }}">{{ safeHTML $shortcut.Name }}</a>{{ $shortcut.Post }}</li> + {{- end }} + {{- end }} + {{- end }} + </ul> + </nav> + <article> + {{- .Content }} + </article> + <footer> + {{- with .Site.Menus.shortcuts }} + <ul> + {{- range sort . "Weight" }} + {{- $shortcut := . }} + {{- with $page.Site.GetPage (printf "%s" $shortcut.URL ) }} + {{- $to := . }} + <li>{{ $shortcut.Pre }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ safeHTML $shortcut.Name }}</a>{{ $shortcut.Post }}</li> + {{- else }} + <li>{{ $shortcut.Pre }}<a href="{{ $shortcut.URL | relLangURL }}">{{ safeHTML $shortcut.Name }}</a>{{ $shortcut.Post }}</li> + {{- end }} + {{- end }} + <li><a id="toggle-theme" class="fas fa-toggle-on" onclick="toggleTheme()" title="{{ $page.Site.Params.toggleTheme }}"></a></li> + </ul> + {{- end }} + <div class="license">{{ .Site.Params.license | safeHTML }}</div> + </footer> +</body> +</html> diff --git a/themes/hugo-theme-relearn/layouts/partials/menu-footer.html b/themes/hugo-theme-relearn/layouts/partials/menu-footer.html index 9ab044cbf4c82742e7372056204a8b0164a60c32..134008dbe5f250f798cde825abf95191b9a3de30 100644 --- a/themes/hugo-theme-relearn/layouts/partials/menu-footer.html +++ b/themes/hugo-theme-relearn/layouts/partials/menu-footer.html @@ -1,4 +1 @@ -<!-- - <p>Built with <a href="https://github.com/McShelby/hugo-theme-relearn" title="love"><i class="fas fa-heart"></i></a> by <a href="https://gohugo.io/">Hugo</a></p> ---> - <div class="license">Sauf mention contraire, tous les textes de ce site sont sous <a href="https://www.etalab.gouv.fr/licence-ouverte-open-licence/" target="_blank">licence etalab-2.0</a>.</div> +<div class="license">{{ .Site.Params.license | safeHTML }}</div> \ No newline at end of file diff --git a/themes/hugo-theme-relearn/layouts/shortcodes/agrometinfoAppUrl.html b/themes/hugo-theme-relearn/layouts/shortcodes/agrometinfoAppUrl.html new file mode 100644 index 0000000000000000000000000000000000000000..9c10b91943ec42c2e77a21980b59d386826599bc --- /dev/null +++ b/themes/hugo-theme-relearn/layouts/shortcodes/agrometinfoAppUrl.html @@ -0,0 +1 @@ +{{ .Page.Site.Params.baseURL }}app/ \ No newline at end of file diff --git a/themes/hugo-theme-relearn/static/css/home.css b/themes/hugo-theme-relearn/static/css/home.css new file mode 100644 index 0000000000000000000000000000000000000000..f5721d2f0b71f75efe43e31e96c67c59b2ff7287 --- /dev/null +++ b/themes/hugo-theme-relearn/static/css/home.css @@ -0,0 +1,193 @@ +a { + color: var(--INTERNAL-MAIN-LINK-color); + text-decoration: none; +} + +article { + background-color: var(--INTERNAL-MAIN-BG-color); +} + +article, +footer { + margin-left: auto; + margin-right: auto; + padding: 1em; +} + +@media (min-width:768px) { + article, + footer { + width:750px + } +} + +@media (min-width: 1200px) { + article, + footer { + width: 1170px; + } +} + +body { + background-color: var(--INTERNAL-MENU-SECTIONS-BG-color); + color: var(--INTERNAL-MAIN-TEXT-color); + font-family: var(--INTERNAL-MAIN-font); + font-size: 1.015625rem; + font-weight: var(--FONT-WEIGHT); + line-height: 1.574; + margin: 0; +} + +nav>ul { + margin-top: 0; +} + +footer>ul { + box-shadow: inset 0 1px 0 0 var(--INTERNAL-BORDER-color); + padding: .5rem 0 1rem; +} + +footer>ul, +nav>ul { + align-items: baseline; + display: flex; + flex-wrap: wrap; + list-style: none; + max-width: 100%; + padding-left: 0; + padding-right: 0.5em; + width: 100%; +} + +footer>ul>li { + border-left: 1px solid var(--INTERNAL-BORDER-color); +} +footer>ul>li:first-child { + border-left: none; +} + +footer>ul>li, +nav>ul>li { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +li.brand { + padding-left: 0; +} + +p { + margin: 1rem 0; +} + +.agroclim-apps { + cursor: pointer; + position: absolute; + right: 0.5em; + top: 0.5em; + z-index: 1000; +} + +.agroclim-apps .menu { + background-color: var(--INTERNAL-MENU-SECTIONS-BG-color); + display: none; + margin-top: 2em; + padding: 15px; +} + +.agroclim-apps i { + background-color: var(--INTERNAL-MAIN-BG-color); + color: var(--INTERNAL-MAIN-LINK-color); + float: right; +} + +.agroclim-apps img { + height: 60px; + width: 60px; +} + +.agroclim-apps ul { + box-sizing: content-box; + list-style: none; + padding-left: 0; + width: 210px; +} + +.agroclim-apps:focus .menu, +.agroclim-apps:hover .menu { + display: block; +} + +.agroclim-apps li { + display: inline-block; + padding-bottom: 15px; + text-align: center; + width: 100px; +} + +.agrometinfo li>a { + display: block; + padding-bottom: 0px; + padding-top: 0px; +} + +.app { + text-align: center; +} + +.app > a { + background-color: var(--INTERNAL-MAIN-LINK-color);; + border: 1px solid; + border-color: var(--INTERNAL-MAIN-LINK-color);; + color: var(--INTERNAL-MAIN-BG-color); + padding: 1rem; + line-height: 1.33; + border-radius: 6px; + text-decoration: none; +} + +.app > a:hover { + background-color: #eee; + border-color: #eee; + color: var(--INTERNAL-MAIN-LINK-color); +} + +.app > a > span { + padding-right: 0.5rem; +} + +.brand img { + background-color: #ffffff; + max-width: 128px; +} + +.license { + font-size: 0.75rem; + padding: 1em 1em 0 2em; +} + + +:root { + color-scheme: light dark; + --INTERNAL-MAIN-font: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; +} + +[data-theme="light"] { + --FONT-WEIGHT: 300; + --INTERNAL-BORDER-color: #dddddd; + --INTERNAL-MAIN-BG-color: rgba(255, 255, 255, 1); + --INTERNAL-MAIN-LINK-color: rgba(72, 106, 201, 1); + --INTERNAL-MAIN-TEXT-color: rgba(16, 16, 16, 1); + --INTERNAL-MENU-SECTIONS-BG-color: #f7f7f7; + --MENU-HOME-LINK-color: rgba( 64, 64, 64, 1 ); +} + +[data-theme="dark"] { + --FONT-WEIGHT: 400; + --INTERNAL-BORDER-color: #656565; + --INTERNAL-MAIN-BG-color: rgba(32, 32, 32, 1); + --INTERNAL-MAIN-LINK-color: rgb(129, 159, 245); + --INTERNAL-MAIN-TEXT-color: rgba(224, 224, 224, 1); + --INTERNAL-MENU-SECTIONS-BG-color: rgba(39, 39, 39, 1); + --MENU-HOME-LINK-color: rgba( 224, 224, 224, 1 ); +}