From a60a600522b9c638cf06fc484d80209dfb7d5c20 Mon Sep 17 00:00:00 2001 From: JustZvan Date: Tue, 24 Mar 2026 20:14:42 +0100 Subject: feat: initial commit --- themes/JustZvan/layouts/_partials/footer.html | 1 + themes/JustZvan/layouts/_partials/head.html | 5 +++ themes/JustZvan/layouts/_partials/head/css.html | 9 +++++ themes/JustZvan/layouts/_partials/head/js.html | 16 ++++++++ themes/JustZvan/layouts/_partials/header.html | 1 + themes/JustZvan/layouts/_partials/menu.html | 51 +++++++++++++++++++++++++ themes/JustZvan/layouts/_partials/terms.html | 23 +++++++++++ themes/JustZvan/layouts/baseof.html | 21 ++++++++++ themes/JustZvan/layouts/home.html | 17 +++++++++ themes/JustZvan/layouts/page.html | 18 +++++++++ themes/JustZvan/layouts/posts/single.html | 11 ++++++ themes/JustZvan/layouts/section.html | 26 +++++++++++++ themes/JustZvan/layouts/taxonomy.html | 7 ++++ themes/JustZvan/layouts/term.html | 26 +++++++++++++ 14 files changed, 232 insertions(+) create mode 100644 themes/JustZvan/layouts/_partials/footer.html create mode 100644 themes/JustZvan/layouts/_partials/head.html create mode 100644 themes/JustZvan/layouts/_partials/head/css.html create mode 100644 themes/JustZvan/layouts/_partials/head/js.html create mode 100644 themes/JustZvan/layouts/_partials/header.html create mode 100644 themes/JustZvan/layouts/_partials/menu.html create mode 100644 themes/JustZvan/layouts/_partials/terms.html create mode 100644 themes/JustZvan/layouts/baseof.html create mode 100644 themes/JustZvan/layouts/home.html create mode 100644 themes/JustZvan/layouts/page.html create mode 100644 themes/JustZvan/layouts/posts/single.html create mode 100644 themes/JustZvan/layouts/section.html create mode 100644 themes/JustZvan/layouts/taxonomy.html create mode 100644 themes/JustZvan/layouts/term.html (limited to 'themes/JustZvan/layouts') diff --git a/themes/JustZvan/layouts/_partials/footer.html b/themes/JustZvan/layouts/_partials/footer.html new file mode 100644 index 0000000..53920d0 --- /dev/null +++ b/themes/JustZvan/layouts/_partials/footer.html @@ -0,0 +1 @@ +

Copyright JustZvan {{ now.Year }}. All blog posts on this website are licensed under the JZSCL.

diff --git a/themes/JustZvan/layouts/_partials/head.html b/themes/JustZvan/layouts/_partials/head.html new file mode 100644 index 0000000..02c2240 --- /dev/null +++ b/themes/JustZvan/layouts/_partials/head.html @@ -0,0 +1,5 @@ + + +{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} +{{ partialCached "head/css.html" . }} +{{ partialCached "head/js.html" . }} diff --git a/themes/JustZvan/layouts/_partials/head/css.html b/themes/JustZvan/layouts/_partials/head/css.html new file mode 100644 index 0000000..d76d23a --- /dev/null +++ b/themes/JustZvan/layouts/_partials/head/css.html @@ -0,0 +1,9 @@ +{{- with resources.Get "css/main.css" }} + {{- if hugo.IsDevelopment }} + + {{- else }} + {{- with . | minify | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} diff --git a/themes/JustZvan/layouts/_partials/head/js.html b/themes/JustZvan/layouts/_partials/head/js.html new file mode 100644 index 0000000..16ffbed --- /dev/null +++ b/themes/JustZvan/layouts/_partials/head/js.html @@ -0,0 +1,16 @@ +{{- with resources.Get "js/main.js" }} + {{- $opts := dict + "minify" (not hugo.IsDevelopment) + "sourceMap" (cond hugo.IsDevelopment "external" "") + "targetPath" "js/main.js" + }} + {{- with . | js.Build $opts }} + {{- if hugo.IsDevelopment }} + + {{- else }} + {{- with . | fingerprint }} + + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/themes/JustZvan/layouts/_partials/header.html b/themes/JustZvan/layouts/_partials/header.html new file mode 100644 index 0000000..8995308 --- /dev/null +++ b/themes/JustZvan/layouts/_partials/header.html @@ -0,0 +1 @@ +{{ partial "menu.html" (dict "menuID" "main" "page" .) }} diff --git a/themes/JustZvan/layouts/_partials/menu.html b/themes/JustZvan/layouts/_partials/menu.html new file mode 100644 index 0000000..14245b5 --- /dev/null +++ b/themes/JustZvan/layouts/_partials/menu.html @@ -0,0 +1,51 @@ +{{- /* +Renders a menu for the given menu ID. + +@context {page} page The current page. +@context {string} menuID The menu ID. + +@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }} +*/}} + +{{- $page := .page }} +{{- $menuID := .menuID }} + +{{- with index site.Menus $menuID }} + +{{- end }} + +{{- define "_partials/inline/menu/walk.html" }} + {{- $page := .page }} + {{- range .menuEntries }} + {{- $attrs := dict "href" .URL }} + {{- if $page.IsMenuCurrent .Menu . }} + {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} + {{- else if $page.HasMenuCurrent .Menu .}} + {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} + {{- end }} + {{- $name := .Name }} + {{- with .Identifier }} + {{- with T . }} + {{- $name = . }} + {{- end }} + {{- end }} +
  • + {{ $name }} + {{- with .Children }} + + {{- end }} +
  • + {{- end }} +{{- end }} diff --git a/themes/JustZvan/layouts/_partials/terms.html b/themes/JustZvan/layouts/_partials/terms.html new file mode 100644 index 0000000..8a6ebec --- /dev/null +++ b/themes/JustZvan/layouts/_partials/terms.html @@ -0,0 +1,23 @@ +{{- /* +For a given taxonomy, renders a list of terms assigned to the page. + +@context {page} page The current page. +@context {string} taxonomy The taxonomy. + +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +*/}} + +{{- $page := .page }} +{{- $taxonomy := .taxonomy }} + +{{- with $page.GetTerms $taxonomy }} + {{- $label := (index . 0).Parent.LinkTitle }} +
    +
    {{ $label }}:
    + +
    +{{- end }} diff --git a/themes/JustZvan/layouts/baseof.html b/themes/JustZvan/layouts/baseof.html new file mode 100644 index 0000000..36ca140 --- /dev/null +++ b/themes/JustZvan/layouts/baseof.html @@ -0,0 +1,21 @@ + + + + {{ partial "head.html" . }} + + + {{ if not .IsHome }} +
    + {{ partial "header.html" . }} +
    + {{ end }} +
    + {{ block "main" . }}{{ end }} +
    + {{ if not .IsHome }} + + {{ end }} + + diff --git a/themes/JustZvan/layouts/home.html b/themes/JustZvan/layouts/home.html new file mode 100644 index 0000000..9897f4a --- /dev/null +++ b/themes/JustZvan/layouts/home.html @@ -0,0 +1,17 @@ +{{ define "main" }} +
    +

    {{ site.Title }}

    + {{ with .Content }} +
    {{ . }}
    + {{ end }} + {{ partial "menu.html" (dict "menuID" "main" "page" .) }} + {{ with .Params.socials }} + + {{ end }} +
    + +{{ end }} diff --git a/themes/JustZvan/layouts/page.html b/themes/JustZvan/layouts/page.html new file mode 100644 index 0000000..0c74e02 --- /dev/null +++ b/themes/JustZvan/layouts/page.html @@ -0,0 +1,18 @@ +{{ define "main" }} +
    + + +
    + {{ .Content }} +
    + + {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +
    +{{ end }} diff --git a/themes/JustZvan/layouts/posts/single.html b/themes/JustZvan/layouts/posts/single.html new file mode 100644 index 0000000..2ead5ce --- /dev/null +++ b/themes/JustZvan/layouts/posts/single.html @@ -0,0 +1,11 @@ +{{ define "main" }} +
    +

    {{ .Title }}

    + + {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + + + {{ .Content }} +
    +{{ end }} \ No newline at end of file diff --git a/themes/JustZvan/layouts/section.html b/themes/JustZvan/layouts/section.html new file mode 100644 index 0000000..1712416 --- /dev/null +++ b/themes/JustZvan/layouts/section.html @@ -0,0 +1,26 @@ +{{ define "main" }} +
    +

    {{ .Title }}

    + {{ with .Content }} +
    {{ . }}
    + {{ end }} + +
    + {{ range .Pages }} +
    + {{ if .Date }} +
    + {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format "2006-01-02" }} + +
    + {{ end }} +

    {{ .LinkTitle }}

    + {{ with .Params.subtitle }} +
    {{ . }}
    + {{ end }} +
    + {{ end }} +
    +
    +{{ end }} diff --git a/themes/JustZvan/layouts/taxonomy.html b/themes/JustZvan/layouts/taxonomy.html new file mode 100644 index 0000000..c2e7875 --- /dev/null +++ b/themes/JustZvan/layouts/taxonomy.html @@ -0,0 +1,7 @@ +{{ define "main" }} +

    {{ .Title }}

    + {{ .Content }} + {{ range .Pages }} +

    {{ .LinkTitle }}

    + {{ end }} +{{ end }} diff --git a/themes/JustZvan/layouts/term.html b/themes/JustZvan/layouts/term.html new file mode 100644 index 0000000..1712416 --- /dev/null +++ b/themes/JustZvan/layouts/term.html @@ -0,0 +1,26 @@ +{{ define "main" }} +
    +

    {{ .Title }}

    + {{ with .Content }} +
    {{ . }}
    + {{ end }} + +
    + {{ range .Pages }} +
    + {{ if .Date }} +
    + {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format "2006-01-02" }} + +
    + {{ end }} +

    {{ .LinkTitle }}

    + {{ with .Params.subtitle }} +
    {{ . }}
    + {{ end }} +
    + {{ end }} +
    +
    +{{ end }} -- cgit v1.2.3