diff options
| -rw-r--r-- | assets/sass/_custom.scss | 24 | ||||
| -rw-r--r-- | config.toml | 10 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 12 | ||||
| -rw-r--r-- | layouts/partials/head.html | 5 |
4 files changed, 51 insertions, 0 deletions
diff --git a/assets/sass/_custom.scss b/assets/sass/_custom.scss index 6f14db7..fc87bbf 100644 --- a/assets/sass/_custom.scss +++ b/assets/sass/_custom.scss @@ -116,3 +116,27 @@ ol li::marker { text-decoration-style: wavy; text-decoration-color: #CC0000; } + +nav.i18n { + display: flex; + flex-direction: row; + + svg { + min-width: 50px; + align-self: center; + } + + ul { + display: flex; + flex-direction: row; + flex-wrap: wrap; + } + + li { + padding: 0; + } + + a { + text-decoration: underline; + } +} diff --git a/config.toml b/config.toml index 891842f..cfc2bd1 100644 --- a/config.toml +++ b/config.toml @@ -5,3 +5,13 @@ theme = ["github.com/onweru/compose"] [outputs] home = ["HTML", "RSS","JSON"] + +[languages] + [languages.en] + title = 'Write Free Software' + languageName = 'English' + weight = 1 + [languages.fr] + title = 'Écrire un logiciel libre' + languageName = 'Français' + weight = 1 diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index cd4e362..cf757e6 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -7,5 +7,17 @@ <a href="https://fontawesome.com" class="non-free" title="This link will take you to a non-free website">https://fontawesome.com</a> – CC-BY 4.0 </small></p> <a href="#pagetop" id="toTop" title={{ T "to_top" }}></a> + {{ if .IsTranslated }} + <nav class="i18n"> + <svg xmlns="http://www.w3.org/2000/svg" height="1.25em" viewBox="0 0 640 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#3366cc}</style><path d="M0 128C0 92.7 28.7 64 64 64H256h48 16H576c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H320 304 256 64c-35.3 0-64-28.7-64-64V128zm320 0V384H576V128H320zM178.3 175.9c-3.2-7.2-10.4-11.9-18.3-11.9s-15.1 4.7-18.3 11.9l-64 144c-4.5 10.1 .1 21.9 10.2 26.4s21.9-.1 26.4-10.2l8.9-20.1h73.6l8.9 20.1c4.5 10.1 16.3 14.6 26.4 10.2s14.6-16.3 10.2-26.4l-64-144zM160 233.2L179 276H141l19-42.8zM448 164c11 0 20 9 20 20v4h44 16c11 0 20 9 20 20s-9 20-20 20h-2l-1.6 4.5c-8.9 24.4-22.4 46.6-39.6 65.4c.9 .6 1.8 1.1 2.7 1.6l18.9 11.3c9.5 5.7 12.5 18 6.9 27.4s-18 12.5-27.4 6.9l-18.9-11.3c-4.5-2.7-8.8-5.5-13.1-8.5c-10.6 7.5-21.9 14-34 19.4l-3.6 1.6c-10.1 4.5-21.9-.1-26.4-10.2s.1-21.9 10.2-26.4l3.6-1.6c6.4-2.9 12.6-6.1 18.5-9.8l-12.2-12.2c-7.8-7.8-7.8-20.5 0-28.3s20.5-7.8 28.3 0l14.6 14.6 .5 .5c12.4-13.1 22.5-28.3 29.8-45H448 376c-11 0-20-9-20-20s9-20 20-20h52v-4c0-11 9-20 20-20z"/></svg> + <ul> + {{ range .Translations }} + <li> + <a class="nav-link" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> + </li> + {{ end }} + </ul> + </nav> + {{ end }} </div> </footer> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2347b12..960fb39 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,6 +1,11 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/svg" href="/images/wfs-icon.svg"> +{{ if .IsTranslated }} +{{ range .Translations }} +<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}"> +{{ end }} +{{ end }} {{- hugo.Generator }} {{- $t := .Title }} {{- $s := site.Title }} |
