From 3665a521e4e80539454bde5a0fa99a70c688dcc2 Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Thu, 7 Jul 2022 11:32:11 +0200 Subject: [PATCH 1/4] feat: update lang attribute --- config/_default/config.toml | 3 +-- config/_default/languages.toml | 3 +++ config/_default/params.toml | 2 +- layouts/_default/baseof.html | 2 +- layouts/rss.xml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/_default/config.toml b/config/_default/config.toml index b6a1f4e..5de086f 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -5,13 +5,12 @@ disableHugoGeneratorInject = true enableEmoji = true enableGitInfo = false enableRobotsTXT = true -languageCode = "en-US" paginate = 7 rssLimit = 10 # Multilingual defaultContentLanguage = "en" -disableLanguages = ["de", "nl"] +# disableLanguages = ["de", "nl"] # defaultContentLanguageInSubdir = true # add redirects/headers diff --git a/config/_default/languages.toml b/config/_default/languages.toml index 1f0ca3e..ffb15f9 100644 --- a/config/_default/languages.toml +++ b/config/_default/languages.toml @@ -4,6 +4,7 @@ weight = 10 [en.params] languageISO = "EN" + languageTag = "en-US" [de] languageName = "German" @@ -11,6 +12,7 @@ weight = 15 [de.params] languageISO = "DE" + languageTag = "de-DE" [nl] languageName = "Nederlands" @@ -18,6 +20,7 @@ weight = 20 [nl.params] languageISO = "NL" + languageTag = "nl-NL" titleAddition = "Modern documentatie-thema" description = "Doks is een Hugo-thema waarmee je moderne documentatie-websites kunt bouwen die veilig, snel en klaar voor SEO zijn — standaard." titleHome = "Doks thema" diff --git a/config/_default/params.toml b/config/_default/params.toml index 2c2a2ca..394e709 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -101,7 +101,7 @@ lastMod = false breadCrumb = false highLight = true kaTex = false - multilingualMode = false + multilingualMode = true docsVersioning = false fullWidth = false navbarSticky = true diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 97d74f6..155ff84 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,5 @@ - + {{ partial "head/head.html" . }} {{ if eq .Kind "home" -}} {{ .Scratch.Set "class" "home" -}} diff --git a/layouts/rss.xml b/layouts/rss.xml index b8f563e..3a5bb13 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -4,7 +4,7 @@ {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} - Hugo -- gohugo.io{{ with .Site.LanguageCode }} + Hugo -- gohugo.io{{ with .Site.Params.languageTag | default "en-US" }} {{.}}{{end}}{{ with .Site.Author.email }} {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Params.copyRight }} From 21ecb63863515d869f09df829958890a213bc25b Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Thu, 7 Jul 2022 11:59:56 +0200 Subject: [PATCH 2/4] ux: make button border navbar transparent --- assets/scss/layouts/_header.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assets/scss/layouts/_header.scss b/assets/scss/layouts/_header.scss index 7bc7323..a0b4a0a 100644 --- a/assets/scss/layouts/_header.scss +++ b/assets/scss/layouts/_header.scss @@ -413,6 +413,11 @@ button#doks-versions { .btn-menu { margin-left: 1rem; + border: transparent; +} + +.btn-doks-light { + border: transparent; } .btn-menu, @@ -426,12 +431,15 @@ button#doks-versions { .btn-doks-light:hover, .doks-sidebar-toggle:hover { background: $pink-100; + border: transparent; } .btn-menu:focus, +.btn-doks-light:focus, .doks-sidebar-toggle:focus, .doks-mode-toggle:focus { outline: 0; + border: transparent; } .doks-sidebar-toggle .doks-collapse, From 76544a40c6ea69c0234a1233c473db4722f5665c Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Thu, 7 Jul 2022 12:47:20 +0200 Subject: [PATCH 3/4] ux: localize strings --- i18n/de.yaml | 5 +++++ i18n/en.toml | 2 -- i18n/en.yaml | 17 +++++++++++++++++ i18n/nl.toml | 2 -- i18n/nl.yaml | 17 +++++++++++++++++ layouts/404.html | 4 ++-- layouts/index.html | 2 +- layouts/partials/header/header.html | 4 ++-- layouts/partials/sidebar/docs-toc.html | 4 ++-- 9 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 i18n/de.yaml delete mode 100644 i18n/en.toml create mode 100644 i18n/en.yaml delete mode 100644 i18n/nl.toml create mode 100644 i18n/nl.yaml diff --git a/i18n/de.yaml b/i18n/de.yaml new file mode 100644 index 0000000..d1f125e --- /dev/null +++ b/i18n/de.yaml @@ -0,0 +1,5 @@ +- id: get-started + translation: "Loslegen" + +- id: on-this-page + translation: "Auf dieser Seite" diff --git a/i18n/en.toml b/i18n/en.toml deleted file mode 100644 index cb52685..0000000 --- a/i18n/en.toml +++ /dev/null @@ -1,2 +0,0 @@ -[get-started] - other = "Get Started" \ No newline at end of file diff --git a/i18n/en.yaml b/i18n/en.yaml new file mode 100644 index 0000000..05ff248 --- /dev/null +++ b/i18n/en.yaml @@ -0,0 +1,17 @@ +- id: get-started + translation: "Get Started" + +- id: on-this-page + translation: "On this page" + +- id: search-text + translation: "Search docs..." + +- id: 404-title + translation: "Page not found :(" + +- id: 404-text + translation: "The page you are looking for doesn't exist or has been moved." + +- id: browse + translation: "Browse" diff --git a/i18n/nl.toml b/i18n/nl.toml deleted file mode 100644 index f80323e..0000000 --- a/i18n/nl.toml +++ /dev/null @@ -1,2 +0,0 @@ -[get-started] - other = "Aan de slag" \ No newline at end of file diff --git a/i18n/nl.yaml b/i18n/nl.yaml new file mode 100644 index 0000000..2899eda --- /dev/null +++ b/i18n/nl.yaml @@ -0,0 +1,17 @@ +- id: get-started + translation: "Aan de slag" + +- id: on-this-page + translation: "Op deze pagina" + +- id: search-text + translation: "Zoeken..." + +- id: 404-title + translation: "Pagina niet gevonden :(" + +- id: 404-text + translation: "De gezochte pagina bestaat niet of deze is verplaatst." + +- id: browse + translation: "Browse" diff --git a/layouts/404.html b/layouts/404.html index f1fe6bf..76d447a 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -2,8 +2,8 @@
-

Page not found :(

-

The page you are looking for doesn't exist or has been moved.

+

{{ i18n "404-title" }}

+

{{ i18n "404-text" }}

diff --git a/layouts/index.html b/layouts/index.html index 57c2e84..8daf8c0 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -6,7 +6,7 @@ diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html index 93584f4..96e6fa5 100644 --- a/layouts/partials/header/header.html +++ b/layouts/partials/header/header.html @@ -22,7 +22,7 @@
-
Browse {{ .Section }}
+
{{ i18n "browse" }} {{ .Section }}
@@ -87,7 +87,7 @@ {{ if $showFlexSearch -}}
{{ end -}} diff --git a/layouts/partials/sidebar/docs-toc.html b/layouts/partials/sidebar/docs-toc.html index 60572b7..c71a7b8 100644 --- a/layouts/partials/sidebar/docs-toc.html +++ b/layouts/partials/sidebar/docs-toc.html @@ -1,7 +1,7 @@ {{ if and (ne .Params.toc false) (ne .TableOfContents "") -}}