From 7ca4b0c7ada64213c5418131299456f05b7082f9 Mon Sep 17 00:00:00 2001 From: matcornic Date: Thu, 3 Aug 2017 02:18:27 +0200 Subject: [PATCH] feat: add theme variant system + add blue variant --- exampleSite/README.md | 2 +- exampleSite/config.toml | 43 +++++++++++++---- exampleSite/i18n/en.toml | 0 exampleSite/i18n/fr.toml | 0 i18n/en.toml | 5 +- i18n/fr.toml | 5 +- i18n/nb.toml | 20 -------- layouts/404.html | 21 +++++--- layouts/partials/header.html | 23 +++++---- layouts/partials/menu.html | 4 +- static/css/theme-blue.css | 94 ++++++++++++++++++++++++++++++++++++ static/css/theme.css | 1 + 12 files changed, 167 insertions(+), 51 deletions(-) create mode 100644 exampleSite/i18n/en.toml create mode 100644 exampleSite/i18n/fr.toml delete mode 100644 i18n/nb.toml create mode 100644 static/css/theme-blue.css diff --git a/exampleSite/README.md b/exampleSite/README.md index c7263bfaa6..913dd2c27e 100644 --- a/exampleSite/README.md +++ b/exampleSite/README.md @@ -2,7 +2,7 @@ - créer une section Showcase - créer des jolis thèmes de base (avec des noms ou au moins de meilleures couleurs) -> TODO - Menus déroulants icone -> TODO -- Bug bizarre en prod sur un des menus. +- Comprendre le pbm de Travis -> TODO - Section "MORE" -> OK - ajouter les childs -> OK diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 6d73b96d7a..7c970bebb1 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -17,6 +17,8 @@ defaultContentLanguageInSubdir= true ordersectionsby = "weight" # ordersectionsby = "title" disableInlineCopyToClipBoard = true # default to false showVisitedLinks = true + themeVariant = "blue" + enableShortcutsTitle = true [outputs] home = [ "HTML", "RSS", "JSON"] @@ -28,30 +30,51 @@ title = "Documentation for Hugo Learn Theme" weight = 1 languageName = "English" -[Languages.fr] -title = "Documentation du thème Hugo Learn" -weight = 2 -languageName = "Français" - -[[menu.shortcuts]] -pre = "

More

" +[[Languages.en.menu.shortcuts]] name = " Github repo" identifier = "ds" url = "https://github.com/vjeantet/hugo-theme-docdock" weight = 10 -[[menu.shortcuts]] +[[Languages.en.menu.shortcuts]] name = " Showcases" url = "/showcase" weight = 11 -[[menu.shortcuts]] +[[Languages.en.menu.shortcuts]] name = " Hugo Documentation" identifier = "hugodoc" url = "https://gohugo.io/" weight = 20 -[[menu.shortcuts]] +[[Languages.en.menu.shortcuts]] name = " Credits" url = "/credits" +weight = 30 + +[Languages.fr] +title = "Documentation du thème Hugo Learn" +weight = 2 +languageName = "Français" + +[[Languages.fr.menu.shortcuts]] +name = " Repo Github" +identifier = "ds" +url = "https://github.com/matcornic/hugo-theme-learn" +weight = 10 + +[[Languages.fr.menu.shortcuts]] +name = " Vitrine" +url = "/fr/showcase" +weight = 11 + +[[Languages.fr.menu.shortcuts]] +name = " Documentation Hugo" +identifier = "hugodoc" +url = "https://gohugo.io/" +weight = 20 + +[[Languages.fr.menu.shortcuts]] +name = " Crédits" +url = "/fr/credits" weight = 30 \ No newline at end of file diff --git a/exampleSite/i18n/en.toml b/exampleSite/i18n/en.toml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/exampleSite/i18n/fr.toml b/exampleSite/i18n/fr.toml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/i18n/en.toml b/i18n/en.toml index 0a0077079b..56a1af4fc5 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -17,4 +17,7 @@ other = "Woops. Looks like this page doesn't exist ¯\\_(ツ)_/¯." other = "Go to homepage" [Edit-this-page] -other = "Edit page" \ No newline at end of file +other = "Edit page" + +[Shortcuts-Title] +other = "More" \ No newline at end of file diff --git a/i18n/fr.toml b/i18n/fr.toml index c537a328c3..6937c4695f 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -17,4 +17,7 @@ other = "Oups. On dirait que cette page n'existe pas ¯\\_(ツ)_/¯" other = "Vers la page d'accueil" [Edit-this-page] -other = "Modifier la page" \ No newline at end of file +other = "Modifier la page" + +[Shortcuts-Title] +other = "Aller plus loin" \ No newline at end of file diff --git a/i18n/nb.toml b/i18n/nb.toml deleted file mode 100644 index e94d469fd0..0000000000 --- a/i18n/nb.toml +++ /dev/null @@ -1,20 +0,0 @@ -[Search-placeholder] -other = "Søk..." - -[Clear-History] -other = "Fjern historikk" - -[Attachments-label] -other = "Vedlegg" - -[title-404] -other = "Feil" - -[message-404] -other = "Ups... Ser ikke ut som denne siden eksisterer ¯\\_(ツ)_/¯." - -[Go-to-homepage] -other = "Gå til hovedsiden" - -[Edit-this-page] -other = "Editer" \ No newline at end of file diff --git a/layouts/404.html b/layouts/404.html index 17c4aca7ce..556cbcecb9 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -5,14 +5,19 @@ {{ partial "meta.html" . }} {{ partial "favicon.html" . }} {{ .Scratch.Add "title" "" }}{{ if eq .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}} {{ .Scratch.Get "title" }} - - - - - - - -