diff --git a/assets/css/custom.css b/assets/css/custom.css index 90a2bc6..88ee472 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -28,3 +28,7 @@ html body ::selection{ border-radius: 50%; } +.footer__copy { + white-space: wrap !important; +} + diff --git a/hugo.toml b/hugo.toml index 5d8cbec..5246af8 100644 --- a/hugo.toml +++ b/hugo.toml @@ -12,6 +12,9 @@ enableRobotsTXT = true disableTags = false enable = true +[params.languages.selector.disable] + footer = false + [languages] [languages.en] disabled = false @@ -115,23 +118,38 @@ enableRobotsTXT = true [params.plugins] # CSS Plugins [[params.plugins.css]] - URL = "css/main.css" - [[params.plugins.css]] - URL = "css/custom.css" + URL = "css/custom.css" [[params.plugins.css]] - URL = "css/adritian-icons.css" + URL = "css/adritian-icons.css" # JS Plugins [[params.plugins.js]] - URL = "js/rad-animations.js" + URL = "js/rad-animations.js" [[params.plugins.js]] - URL = "js/sticky-header.js" + URL = "js/sticky-header.js" [[params.plugins.js]] - URL = "js/library/fontfaceobserver.js" + URL = "js/library/fontfaceobserver.js" # SCSS Plugins [[params.plugins.scss]] - URL = "scss/adritian.scss" + URL = "scss/adritian.scss" + +# theme/color style +[params.colorTheme] + +## the following configuration would disable automatic theme selection +# [params.colorTheme.auto] +# disable = true +# [params.colorTheme.forced] +# theme = "dark" + +## the following parameter will disable theme override in the footer +# [params.colorTheme.selector.disable] +# footer = true + + +## by default we allow override AND automatic selection + [params] # Open Graph diff --git a/i18n/en.yaml b/i18n/en.yaml index ab59bbe..6b15ef2 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -12,6 +12,18 @@ - id: "language" translation: "Language" +- id: "toggle_theme" + translation: "Toggle theme" + +- id: "theme_light" + translation: "☀️ Light" + +- id: "theme_dark" + translation: "🌑 Dark" + +- id: "theme_auto" + translation: "✨ Auto" + ## Homepage head title - id: "head_title" translation: "David Corto Camacho | Senior Software Engineer & Tech Lead at Deporvillage" diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2600a2e..2215685 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -47,7 +47,6 @@ {{- if hugo.IsProduction }} {{- $css = $css | minify | fingerprint | resources.PostProcess }} {{- end }} - <link rel="preload" href="{{ $css.RelPermalink }}" @@ -68,6 +67,27 @@ {{- end }} /> </noscript> +{{- range .Site.Params.plugins.scss }} + {{- $scss := resources.Get .URL }} + {{- $style := $scss | css.Sass }} + {{- if hugo.IsProduction }} + {{- $style = $scss | css.Sass | resources.Minify | resources.Fingerprint }} + {{- end }} +<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous"/> +{{- end }} + + +<!-- printed only it not disabled --> +{{- if not .Site.Params.colorTheme.auto.disable }} +{{- $colorModesScript := resources.Get "js/color-modes.js" }} +{{- if hugo.IsProduction }} + {{- $colorModesScript = $colorModesScript | resources.Minify | resources.Fingerprint }} +{{- end }} +<script defer src="{{ $colorModesScript.Permalink }}"></script> +{{- else }} +<!-- disabled color theme selector --> +{{- end }} + {{- if .Site.Params.analytics.google_tag_manager.enabled }} <!-- Google tag (gtag.js), google analytics --> <script defer src="https://www.googletagmanager.com/gtag/js?id=UA-465407-4"></script> @@ -78,4 +98,4 @@ {{- end }} <script src='{{ "js/library/lozad.min.js" | absURL }}'></script> -{{ template "_internal/opengraph.html" . }} \ No newline at end of file +{{ template "_internal/opengraph.html" . }} diff --git a/themes/adritian-free-hugo-theme b/themes/adritian-free-hugo-theme index 61a5a3b..3ba6d3f 160000 --- a/themes/adritian-free-hugo-theme +++ b/themes/adritian-free-hugo-theme @@ -1 +1 @@ -Subproject commit 61a5a3b830c8e124acebaa6a14e759c1ada9c3b1 +Subproject commit 3ba6d3f64f6f307e73fbe29bfff96bf7218d2c18