diff --git a/README.md b/README.md index 562c631..c7f14a6 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,6 @@ theme = ["GDCDocsTheme", "docsy"] ## License -(C) 2007-2023 GoodData Corporation +(C) 2007-2026 GoodData Corporation For more information, please see [LICENSE](LICENSE). diff --git a/assets/icons/chevron-menu.svg b/assets/icons/chevron-menu.svg index 49bf10a..6dc79b0 100644 --- a/assets/icons/chevron-menu.svg +++ b/assets/icons/chevron-menu.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/icons/icon-moon.svg b/assets/icons/icon-moon.svg new file mode 100644 index 0000000..e080719 --- /dev/null +++ b/assets/icons/icon-moon.svg @@ -0,0 +1 @@ + diff --git a/assets/icons/icon-sun.svg b/assets/icons/icon-sun.svg new file mode 100644 index 0000000..8e826b2 --- /dev/null +++ b/assets/icons/icon-sun.svg @@ -0,0 +1 @@ + diff --git a/assets/js/base.js b/assets/js/base.js index a63ac70..648ed7c 100644 --- a/assets/js/base.js +++ b/assets/js/base.js @@ -1 +1 @@ -// (C) 2023 GoodData Corporation +// (C) 2026 GoodData Corporation diff --git a/assets/js/theme-switcher.js b/assets/js/theme-switcher.js new file mode 100644 index 0000000..d5728c9 --- /dev/null +++ b/assets/js/theme-switcher.js @@ -0,0 +1,95 @@ +// (C) 2026 GoodData Corporation +// Theme switcher — light / dark preference with localStorage persistence +// and respect for the OS prefers-color-scheme media query. +// +// This script is split in two parts: +// 1. A tiny inline snippet (injected into
via Hugo) that applies the +// stored / OS theme *before* first paint to prevent FOUC. +// 2. The interactive toggle wired to #gd-theme-switcher once the DOM loads. +// +// Only part 2 lives in this file. Part 1 is a separate diff --git a/layouts/partials/head-css.html b/layouts/partials/head-css.html index 2855aec..e454e1d 100644 --- a/layouts/partials/head-css.html +++ b/layouts/partials/head-css.html @@ -1,4 +1,4 @@ -{{/* (C) 2023 GoodData Corporation */}} +{{/* (C) 2026 GoodData Corporation */}} {{ $scssMain := "scss/main.scss"}} {{ if .Site.IsServer }} {{/* Note the missing postCSS. This makes it snappier to develop in Chrome, but makes it look sub-optimal in other browsers. */}} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 9a2077c..a465d9c 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,4 +1,5 @@ -{{/* (C) 2023 GoodData Corporation */}} +{{/* (C) 2026 GoodData Corporation */}} +{{ partial "theme-init.html" . }} {{ hugo.Generator }} diff --git a/layouts/partials/header-menu.html b/layouts/partials/header-menu.html index 9e5b0bb..a8ab3ac 100644 --- a/layouts/partials/header-menu.html +++ b/layouts/partials/header-menu.html @@ -1,4 +1,4 @@ -{{/* (C) 2023 GoodData Corporation */}} +{{/* (C) 2026 GoodData Corporation */}} {{ $dot := . }} {{ $mainMenu := .Site.Menus.main }} {{ if isset .Page.Params "edition" }} diff --git a/layouts/partials/header-right.html b/layouts/partials/header-right.html index 32f6788..878efff 100644 --- a/layouts/partials/header-right.html +++ b/layouts/partials/header-right.html @@ -1,4 +1,4 @@ -{{/* (C) 2023 GoodData Corporation */}} +{{/* (C) 2026 GoodData Corporation */}} {{ $dot := . }} {{ $resources := resources }} diff --git a/layouts/partials/hooks/body-end.html b/layouts/partials/hooks/body-end.html index e205ccd..3ff2ea0 100644 --- a/layouts/partials/hooks/body-end.html +++ b/layouts/partials/hooks/body-end.html @@ -1,4 +1,4 @@ -{{/* (C) 2023 GoodData Corporation */}} +{{/* (C) 2026 GoodData Corporation */}} @@ -10,3 +10,5 @@ +{{ $themeSwitcherJS := resources.Get "js/theme-switcher.js" | minify | fingerprint }} + diff --git a/layouts/partials/lang-switch.html b/layouts/partials/lang-switch.html index 065350c..acebe7f 100644 --- a/layouts/partials/lang-switch.html +++ b/layouts/partials/lang-switch.html @@ -1,4 +1,4 @@ -{{/* (C) 2023 GoodData Corporation */}} +{{/* (C) 2026 GoodData Corporation */}} {{ $currentPage := . }} {{ $site := .Site }} {{ $delimiter := "/" }} diff --git a/layouts/partials/meta-version.html b/layouts/partials/meta-version.html index 2047a0b..93a92cd 100644 --- a/layouts/partials/meta-version.html +++ b/layouts/partials/meta-version.html @@ -1,4 +1,4 @@ -{{/* (C) 2023 GoodData Corporation */}} +{{/* (C) 2026 GoodData Corporation */}} {{ $permalink := .RelPermalink }} {{ $attr := "" }} diff --git a/layouts/partials/navbar-breadcrumb.html b/layouts/partials/navbar-breadcrumb.html index 4462b25..8d40ea6 100644 --- a/layouts/partials/navbar-breadcrumb.html +++ b/layouts/partials/navbar-breadcrumb.html @@ -1,4 +1,4 @@ -{{/* (C) 2023 GoodData Corporation */}} +{{/* (C) 2026 GoodData Corporation */}} {{/* This is overriden in docs (tiger/bear) */}}