Skip to content

Commit

Permalink
upgrade theme to v1.4.11 (#2)
Browse files Browse the repository at this point in the history
* prepare for new theme switcher

* upgrade theme to v1.4.11
  • Loading branch information
dcorto authored Jan 2, 2025
1 parent d6c9bc9 commit aae0298
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 11 deletions.
4 changes: 4 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ html body ::selection{
border-radius: 50%;
}

.footer__copy {
white-space: wrap !important;
}

34 changes: 26 additions & 8 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ enableRobotsTXT = true
disableTags = false
enable = true

[params.languages.selector.disable]
footer = false

[languages]
[languages.en]
disabled = false
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 22 additions & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
{{- if hugo.IsProduction }}
{{- $css = $css | minify | fingerprint | resources.PostProcess }}
{{- end }}

<link
rel="preload"
href="{{ $css.RelPermalink }}"
Expand All @@ -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>
Expand All @@ -78,4 +98,4 @@
{{- end }}
<script src='{{ "js/library/lozad.min.js" | absURL }}'></script>

{{ template "_internal/opengraph.html" . }}
{{ template "_internal/opengraph.html" . }}

0 comments on commit aae0298

Please sign in to comment.