From 4c41e477e13d37e187c8de4225c7e8056bd9ed28 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Mon, 29 Sep 2025 19:17:13 +0200 Subject: Internalise theme --- layouts/partials/footer/copyright.html | 15 ++++++-- layouts/partials/footer/index.html | 4 +++ layouts/partials/footer/social.html | 16 ++++++--- layouts/partials/head/index.html | 2 ++ layouts/partials/head/meta.html | 42 +++++++++++++++++------ layouts/partials/head/styles.html | 22 +++++++----- layouts/partials/header/avatar.html | 17 +++++++--- layouts/partials/header/index.html | 8 +++++ layouts/partials/header/nav.html | 22 +++++++----- layouts/partials/header/theme-button.html | 47 ++++++++++++++++++++++++++ layouts/partials/header/title.html | 8 ++--- layouts/partials/list/default.html | 33 +++++++++++++----- layouts/partials/list/pagination.html | 23 +++++++++++++ layouts/partials/single/comments/disqus.html | 4 +++ layouts/partials/single/comments/giscus.html | 22 ++++++++++++ layouts/partials/single/comments/index.html | 11 ++++++ layouts/partials/single/table-of-contents.html | 6 ++++ layouts/partials/utils/icon.html | 7 ++++ 18 files changed, 253 insertions(+), 56 deletions(-) create mode 100644 layouts/partials/footer/index.html create mode 100644 layouts/partials/head/index.html create mode 100644 layouts/partials/header/index.html create mode 100644 layouts/partials/header/theme-button.html create mode 100644 layouts/partials/list/pagination.html create mode 100644 layouts/partials/single/comments/disqus.html create mode 100644 layouts/partials/single/comments/giscus.html create mode 100644 layouts/partials/single/comments/index.html create mode 100644 layouts/partials/single/table-of-contents.html create mode 100644 layouts/partials/utils/icon.html (limited to 'layouts/partials') diff --git a/layouts/partials/footer/copyright.html b/layouts/partials/footer/copyright.html index b24cc2c..d2c9828 100644 --- a/layouts/partials/footer/copyright.html +++ b/layouts/partials/footer/copyright.html @@ -1,3 +1,12 @@ -
- © {{ replace .Site.Copyright "{year}" now.Year }} — {{ .Site.Title }} with Lowkey -
\ No newline at end of file +
+ © {{ replace .Site.Copyright "{year}" now.Year }} — + {{ .Site.Title }} + with + + Lowkey + +
diff --git a/layouts/partials/footer/index.html b/layouts/partials/footer/index.html new file mode 100644 index 0000000..73f32ae --- /dev/null +++ b/layouts/partials/footer/index.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/layouts/partials/footer/social.html b/layouts/partials/footer/social.html index 0b70dd6..ddf867c 100644 --- a/layouts/partials/footer/social.html +++ b/layouts/partials/footer/social.html @@ -1,5 +1,11 @@ -
- -
\ No newline at end of file +
+ +
diff --git a/layouts/partials/head/index.html b/layouts/partials/head/index.html new file mode 100644 index 0000000..eb096b8 --- /dev/null +++ b/layouts/partials/head/index.html @@ -0,0 +1,2 @@ +{{- partial "head/meta" . -}} +{{- partial "head/styles" . -}} diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html index 23a770a..329d9bf 100644 --- a/layouts/partials/head/meta.html +++ b/layouts/partials/head/meta.html @@ -1,12 +1,32 @@ - - - +{{ $favicon := resources.GetMatch .Site.Params.favicon }} + + + + {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }} - - - -{{ with .OutputFormats.Get "rss" -}} -{{ printf ` -` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} -{{ end }} \ No newline at end of file + + + + + + +{{ if .Site.Config.Services.GoogleAnalytics.ID }} + + + + +{{ end }} diff --git a/layouts/partials/head/styles.html b/layouts/partials/head/styles.html index 68577ce..cfab45a 100644 --- a/layouts/partials/head/styles.html +++ b/layouts/partials/head/styles.html @@ -1,13 +1,17 @@ -{{/* Resources */}} -{{- $tailwind := resources.Get "css/tailwind.css" | postCSS (dict "config" "./config/postcss.config.js") -}} +{{/* Resources */}} +{{- $tailwind := resources.Get "css/tailwind.css" | postCSS (dict "config" "./config/postcss.config.js") -}} -{{/* Processor */}} -{{- $styles := slice $tailwind | resources.Concat "css/app.css" -}} +{{/* MathJax */}} + + -{{/* Output */}} +{{/* Processor */}} +{{- $styles := slice $tailwind | resources.Concat "css/app.css" -}} + +{{/* Output */}} {{- if eq hugo.Environment "development" -}} - -{{- else -}} -{{- $styles := $styles | minify | fingerprint | resources.PostProcess -}} - + +{{- else -}} + {{- $styles := $styles | minify | fingerprint | resources.PostProcess -}} + {{- end -}} diff --git a/layouts/partials/header/avatar.html b/layouts/partials/header/avatar.html index e3c1021..5c9447d 100644 --- a/layouts/partials/header/avatar.html +++ b/layouts/partials/header/avatar.html @@ -1,7 +1,14 @@ -{{ $avatar := resources.GetMatch .Site.Params.avatar }} +{{ $avatar := resources.GetMatch .Site.Params.avatar }} {{ $tiny := ($avatar.Fill "80x80 q90") }} -
- - {{ .Site.Title }} - + + diff --git a/layouts/partials/header/index.html b/layouts/partials/header/index.html new file mode 100644 index 0000000..43debba --- /dev/null +++ b/layouts/partials/header/index.html @@ -0,0 +1,8 @@ +
+ {{ partial "header/avatar" . }} + +
+ {{ partial "header/title" . }} + {{ partial "header/nav" . }} +
+
diff --git a/layouts/partials/header/nav.html b/layouts/partials/header/nav.html index c0c20b3..94b073d 100644 --- a/layouts/partials/header/nav.html +++ b/layouts/partials/header/nav.html @@ -1,10 +1,14 @@ \ No newline at end of file + + diff --git a/layouts/partials/header/theme-button.html b/layouts/partials/header/theme-button.html new file mode 100644 index 0000000..0a8313b --- /dev/null +++ b/layouts/partials/header/theme-button.html @@ -0,0 +1,47 @@ + + + \ No newline at end of file diff --git a/layouts/partials/header/title.html b/layouts/partials/header/title.html index d6e6ba3..11bc434 100644 --- a/layouts/partials/header/title.html +++ b/layouts/partials/header/title.html @@ -1,7 +1,3 @@ - {{ if .IsHome }} -

{{ .Site.Title }}

- {{ else }} -

{{ .Site.Title }}

- {{ end }} -
\ No newline at end of file +

{{ .Site.Title }}

+ diff --git a/layouts/partials/list/default.html b/layouts/partials/list/default.html index a965ce5..f3fd20e 100644 --- a/layouts/partials/list/default.html +++ b/layouts/partials/list/default.html @@ -1,11 +1,28 @@ \ No newline at end of file +
+ +
+ + {{ i18n "readMore" }} + + {{ partial "utils/icon" "arrow-right" }} + + +
+ diff --git a/layouts/partials/list/pagination.html b/layouts/partials/list/pagination.html new file mode 100644 index 0000000..2e9487c --- /dev/null +++ b/layouts/partials/list/pagination.html @@ -0,0 +1,23 @@ +{{ $paginator := .Paginator }} + +
+ +
+ {{ if $paginator.HasPrev }} + + {{ partial "utils/icon" "arrow-left" }} + Newer Posts + + {{ end }} +
+ + +
+ {{ if $paginator.HasNext }} + + Older Posts + {{ partial "utils/icon" "arrow-right" }} + + {{ end }} +
+
diff --git a/layouts/partials/single/comments/disqus.html b/layouts/partials/single/comments/disqus.html new file mode 100644 index 0000000..b794098 --- /dev/null +++ b/layouts/partials/single/comments/disqus.html @@ -0,0 +1,4 @@ +
+ {{/* https://gohugo.io/templates/internal/#disqus */}} + {{- template "_internal/disqus.html" . -}} +
\ No newline at end of file diff --git a/layouts/partials/single/comments/giscus.html b/layouts/partials/single/comments/giscus.html new file mode 100644 index 0000000..00cfec1 --- /dev/null +++ b/layouts/partials/single/comments/giscus.html @@ -0,0 +1,22 @@ +
+ +
\ No newline at end of file diff --git a/layouts/partials/single/comments/index.html b/layouts/partials/single/comments/index.html new file mode 100644 index 0000000..5a4a1c3 --- /dev/null +++ b/layouts/partials/single/comments/index.html @@ -0,0 +1,11 @@ +{{ if .IsPage }} + + {{ if .Site.Params.giscus.enable }} + {{ partial "single/comments/giscus" . }} + {{ end }} + + + {{ if .Site.Params.disqusShortname }} + {{ partial "single/comments/disqus" . }} + {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/single/table-of-contents.html b/layouts/partials/single/table-of-contents.html new file mode 100644 index 0000000..b8489bc --- /dev/null +++ b/layouts/partials/single/table-of-contents.html @@ -0,0 +1,6 @@ +{{ if and .TableOfContents .Params.tableOfContents }} + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/utils/icon.html b/layouts/partials/utils/icon.html new file mode 100644 index 0000000..7f72418 --- /dev/null +++ b/layouts/partials/utils/icon.html @@ -0,0 +1,7 @@ +{{- $iconFile := resources.GetMatch (printf "icons/%s.svg" .) -}} + +{{- if $iconFile -}} + {{- $iconFile.Content | safeHTML -}} +{{- else -}} + {{- errorf "Error: icon '%s.svg' is not found under 'assets/icons' folder" . -}} +{{- end -}} \ No newline at end of file -- cgit v1.3