From 631547a75142326a7c71bdf123e1475217a5ad73 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 22 Apr 2026 12:42:56 +0200 Subject: chore: replace with extracted danix.xyz-hacker theme (danix2-hugo-theme) --- layouts/partials/article-card.html | 92 +++++++++++++ layouts/partials/article-header.html | 71 ++++++++++ layouts/partials/article-list-item.html | 95 +++++++++++++ layouts/partials/article-nav.html | 46 +++++++ layouts/partials/article-types/life.html | 3 + layouts/partials/article-types/link.html | 17 +++ layouts/partials/article-types/photo.html | 19 +++ layouts/partials/article-types/quote.html | 15 ++ layouts/partials/article-types/tech.html | 3 + layouts/partials/back-to-top.html | 23 ++++ layouts/partials/breadcrumb-jsonld.html | 36 +++++ layouts/partials/breadcrumb.html | 16 +++ layouts/partials/footer.html | 89 ++++++++++++ layouts/partials/form-components.html | 219 ++++++++++++++++++++++++++++++ layouts/partials/hamburger-menu.html | 125 +++++++++++++++++ layouts/partials/head-meta.html | 57 ++++++++ layouts/partials/header.html | 94 +++++++++++++ layouts/partials/search-modal.html | 87 ++++++++++++ layouts/partials/sidebar.html | 54 ++++++++ layouts/partials/social-share.html | 123 +++++++++++++++++ layouts/partials/tag-cloud.html | 90 ++++++++++++ layouts/partials/toast-container.html | 13 ++ 22 files changed, 1387 insertions(+) create mode 100644 layouts/partials/article-card.html create mode 100644 layouts/partials/article-header.html create mode 100644 layouts/partials/article-list-item.html create mode 100644 layouts/partials/article-nav.html create mode 100644 layouts/partials/article-types/life.html create mode 100644 layouts/partials/article-types/link.html create mode 100644 layouts/partials/article-types/photo.html create mode 100644 layouts/partials/article-types/quote.html create mode 100644 layouts/partials/article-types/tech.html create mode 100644 layouts/partials/back-to-top.html create mode 100644 layouts/partials/breadcrumb-jsonld.html create mode 100644 layouts/partials/breadcrumb.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/form-components.html create mode 100644 layouts/partials/hamburger-menu.html create mode 100644 layouts/partials/head-meta.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/search-modal.html create mode 100644 layouts/partials/sidebar.html create mode 100644 layouts/partials/social-share.html create mode 100644 layouts/partials/tag-cloud.html create mode 100644 layouts/partials/toast-container.html (limited to 'layouts/partials') diff --git a/layouts/partials/article-card.html b/layouts/partials/article-card.html new file mode 100644 index 0000000..d803464 --- /dev/null +++ b/layouts/partials/article-card.html @@ -0,0 +1,92 @@ +{{ $articleType := .Params.type | default "life" }} +{{ $typeConfig := .Site.Params.articleTypes }} +{{ $typeData := index $typeConfig $articleType }} +{{ $excerpt := .Description | default .Summary }} + +{{ $imageURL := "" }} +{{ $useDefaultThumbnail := false }} +{{ if .Params.image }} + {{ $resource := .Resources.GetMatch .Params.image }} + {{ if $resource }} + {{ $imageURL = $resource.RelPermalink }} + {{ else }} + {{ $imageURL = .Params.image }} + {{ end }} +{{ else }} + {{ $useDefaultThumbnail = true }} +{{ end }} + +
+ + {{ if or $imageURL $useDefaultThumbnail }} + + {{ if $useDefaultThumbnail }} + + + {{ .Title }} + + {{ else }} + {{ .Title }} + {{ end }} + + {{ if $typeData }} +
+ {{ i18n $articleType }} +
+ {{ end }} +
+ {{ end }} + + +
+ + {{ if .Params.pinned }} +
+ ๐Ÿ“Œ PINNED +
+ {{ end }} + + +

+ + {{ .Title }} + +

+ + +
+ +
+ + + {{ if $excerpt }} +

+ {{ $excerpt | plainify }} +

+ {{ end }} + + + + {{ i18n "readMore" }} + + +
+
diff --git a/layouts/partials/article-header.html b/layouts/partials/article-header.html new file mode 100644 index 0000000..94c78a5 --- /dev/null +++ b/layouts/partials/article-header.html @@ -0,0 +1,71 @@ +{{ $articleType := .Params.type | default "life" }} +{{ $typeConfig := .Site.Params.articleTypes }} +{{ $typeData := index $typeConfig $articleType }} +{{ $hasType := .Params.type }} + +
+ +
+ + {{ if and $typeData $hasType }} +
+ {{ end }} + + + {{ if and $typeData $hasType }} +
+ {{ end }} + +

+ {{ .Title }} +

+
+ + +
+ + {{ if .PublishDate }} +
+ + +
+ {{ end }} + + + {{ if .Lastmod }} + {{ $lastmodDate := .Lastmod.Format "2006-01-02" }} + {{ $pubDate := .PublishDate.Format "2006-01-02" }} + {{ if ne $lastmodDate $pubDate }} +
+ + +
+ {{ end }} + {{ end }} + + + {{ if .Site.Params.readingTime }} +
+ + {{ .ReadingTime }} {{ i18n "min" }} {{ i18n "readingTime" }} +
+ {{ end }} + + + {{ if and $typeData $hasType }} + + {{ i18n $articleType }} + + {{ end }} +
+
diff --git a/layouts/partials/article-list-item.html b/layouts/partials/article-list-item.html new file mode 100644 index 0000000..44cbf32 --- /dev/null +++ b/layouts/partials/article-list-item.html @@ -0,0 +1,95 @@ +{{/* Handle both calling conventions: dict with .Page/.side or direct page */}} +{{ $page := . }} +{{ $side := "left" }} + +{{ if reflect.IsMap . }} + {{ $page = .Page }} + {{ $side = .side | default "left" }} +{{ end }} + +{{ $articleType := $page.Params.type | default "life" }} +{{ $typeConfig := $page.Site.Params.articleTypes }} +{{ $typeData := index $typeConfig $articleType }} +{{ $excerpt := $page.Description | default $page.Summary }} + +{{ $imageURL := "" }} +{{ $useDefaultThumbnail := false }} +{{ if $page.Params.image }} + {{ $resource := $page.Resources.GetMatch $page.Params.image }} + {{ if $resource }} + {{ $imageURL = $resource.RelPermalink }} + {{ else }} + {{ $imageURL = $page.Params.image }} + {{ end }} +{{ else }} + {{ $useDefaultThumbnail = true }} +{{ end }} + +
  • + {{/* Decorative connector line */}} + + + {{/* Node on spine */}} + + +
    + + {{/* Thumbnail */}} + + + {{/* Text body */}} +
    + + {{/* Pinned badge */}} + {{ if $page.Params.pinned }} +
    + ๐Ÿ“Œ {{ i18n "pinned" | default "PINNED" }} +
    + {{ end }} + + {{/* Type + date meta row */}} +
    + {{ i18n $articleType | upper }} + + +
    + + {{/* Title */}} +

    + {{ $page.Title }} +

    + + {{/* Excerpt */}} + {{ if $excerpt }} +

    {{ $excerpt | plainify }}

    + {{ end }} + + {{/* CTA */}} + + {{ i18n "readMore" }} + + + +
    +
    +
  • diff --git a/layouts/partials/article-nav.html b/layouts/partials/article-nav.html new file mode 100644 index 0000000..8a118b3 --- /dev/null +++ b/layouts/partials/article-nav.html @@ -0,0 +1,46 @@ +{{ $page := .page }} +{{ $variant := .variant | default "bottom" }} +{{ $prev := $page.PrevInSection }} +{{ $next := $page.NextInSection }} + +{{/* Shell prompt command varies by position */}} +{{ $cmd := "ls ../" }} +{{ if eq $variant "top" }} + {{ $cmd = "cd" }} +{{ end }} + + diff --git a/layouts/partials/article-types/life.html b/layouts/partials/article-types/life.html new file mode 100644 index 0000000..01cd8b8 --- /dev/null +++ b/layouts/partials/article-types/life.html @@ -0,0 +1,3 @@ +
    + {{ .Content }} +
    diff --git a/layouts/partials/article-types/link.html b/layouts/partials/article-types/link.html new file mode 100644 index 0000000..bbf7906 --- /dev/null +++ b/layouts/partials/article-types/link.html @@ -0,0 +1,17 @@ +
    + + {{ .Params.link_title | default (i18n "readMore") }} + + + + +
    + +
    + {{ .Content }} +
    diff --git a/layouts/partials/article-types/photo.html b/layouts/partials/article-types/photo.html new file mode 100644 index 0000000..743e02a --- /dev/null +++ b/layouts/partials/article-types/photo.html @@ -0,0 +1,19 @@ +{{ if .Params.featured_image }} +
    + {{ .Title }} + {{ if .Params.featured_image_caption }} +
    + {{ .Params.featured_image_caption }} +
    + {{ end }} +
    +{{ end }} + +
    + {{ .Content }} +
    diff --git a/layouts/partials/article-types/quote.html b/layouts/partials/article-types/quote.html new file mode 100644 index 0000000..f27d189 --- /dev/null +++ b/layouts/partials/article-types/quote.html @@ -0,0 +1,15 @@ +
    + "{{ .Params.quote_text }}" +
    + +{{ if .Params.quote_author }} +
    + โ€” {{ .Params.quote_author }} +
    +{{ end }} + +{{ if .Content }} +
    + {{ .Content }} +
    +{{ end }} diff --git a/layouts/partials/article-types/tech.html b/layouts/partials/article-types/tech.html new file mode 100644 index 0000000..01cd8b8 --- /dev/null +++ b/layouts/partials/article-types/tech.html @@ -0,0 +1,3 @@ +
    + {{ .Content }} +
    diff --git a/layouts/partials/back-to-top.html b/layouts/partials/back-to-top.html new file mode 100644 index 0000000..75095e3 --- /dev/null +++ b/layouts/partials/back-to-top.html @@ -0,0 +1,23 @@ +
    + +
    diff --git a/layouts/partials/breadcrumb-jsonld.html b/layouts/partials/breadcrumb-jsonld.html new file mode 100644 index 0000000..95b5e69 --- /dev/null +++ b/layouts/partials/breadcrumb-jsonld.html @@ -0,0 +1,36 @@ +{{- $homeURL := absURL "/" -}} +{{- $homeName := i18n "home" -}} +{{- if eq .Lang "it" -}} + {{- $homeURL = absURL "/it/" -}} +{{- end -}} + diff --git a/layouts/partials/breadcrumb.html b/layouts/partials/breadcrumb.html new file mode 100644 index 0000000..c15dfeb --- /dev/null +++ b/layouts/partials/breadcrumb.html @@ -0,0 +1,16 @@ +{{ $homeLink := "/" }} +{{ if eq .Lang "it" }} + {{ $homeLink = "/it/" }} +{{ end }} + + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..1e50d6f --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,89 @@ +{{- $quotes := .Site.Data.quotes.quotes -}} + + diff --git a/layouts/partials/form-components.html b/layouts/partials/form-components.html new file mode 100644 index 0000000..6c6416b --- /dev/null +++ b/layouts/partials/form-components.html @@ -0,0 +1,219 @@ +{{ define "form-components" }} + + + +
    +

    Form Components

    + + +
    + + +
    + + +
    + + +
    {{ i18n "form_invalid_email" }}
    +
    + + +
    + + +
    {{ i18n "form_password_help" | default "Must be at least 8 characters" }}
    +
    + + +
    + + +
    + + + +
    + + +
    + + + +
    + + +
    + + + +
    + +
    + + +
    +

    {{ i18n "form_select_interests" | default "Select your interests" }}

    + + +
    + + + +
    +

    {{ i18n "form_select_preference" | default "Select a preference" }}

    + + +
    + + + +
    +
    + + +
    +
    + + +
    +
    + + + +
    +
    + + +
    + +
    + + + +
    +

    Modal Examples

    + + + +
    + + + +
    +

    Notifications

    + + + + +
    + +
    + + + + + + + + + + + + + +{{ end }} diff --git a/layouts/partials/hamburger-menu.html b/layouts/partials/hamburger-menu.html new file mode 100644 index 0000000..5d8d8ed --- /dev/null +++ b/layouts/partials/hamburger-menu.html @@ -0,0 +1,125 @@ + +
    +
    + +
    + Menu + +
    + + + + + +
    + + + + +
    + +
    + + +
    + {{ i18n "noSearchResults" }} +
    +
    + + +
    +
    {{ i18n "language" }}
    +
    + {{ $currentLang := .Page.Language }} + {{ $currentPath := .RelPermalink }} + {{ range .Site.Languages }} + {{ $langCode := .Lang }} + {{ $langName := .LanguageName }} + {{ $current := eq $langCode $currentLang }} + + {{ $url := $currentPath }} + {{ if eq $langCode "en" }} + {{ if hasPrefix $currentPath "/it/" }} + {{ $url = strings.TrimPrefix "/it" $currentPath }} + {{ end }} + {{ else }} + {{ if not (hasPrefix $currentPath "/it/") }} + {{ $url = printf "/it%s" $currentPath }} + {{ end }} + {{ end }} + + {{ $langName }} + + {{ end }} +
    +
    + +
    +
    + + diff --git a/layouts/partials/head-meta.html b/layouts/partials/head-meta.html new file mode 100644 index 0000000..34a60e2 --- /dev/null +++ b/layouts/partials/head-meta.html @@ -0,0 +1,57 @@ +{{/* description: per-page excerpt wins over site-wide description */}} +{{ $description := .Site.Language.Params.siteDescription }} +{{ with .Params.excerpt }}{{ $description = . }}{{ end }} + +{{/* og:type: "article" only for single content pages that have a date */}} +{{ $ogType := "website" }} +{{ if and (eq .Kind "page") .Date }}{{ $ogType = "article" }}{{ end }} + +{{/* og:image: page image wins; fall back to lamp for homepage, dark thumbnail for articles */}} +{{ $defaultImage := "images/default_thumbnail_dark.png" }} +{{ if .IsHome }}{{ $defaultImage = "images/lampD.png" }}{{ end }} +{{ $ogImage := printf "%s%s" .Site.BaseURL $defaultImage }} +{{ with .Params.image }}{{ $ogImage = printf "%s%s" $.Site.BaseURL (strings.TrimLeft "/" .) }}{{ end }} + +{{/* author: page-level param wins; fall back to site param */}} +{{ $author := .Site.Params.author }} +{{ with .Params.author }}{{ $author = . }}{{ end }} + + + + + + + + + + + +{{ if eq $ogType "article" }} + + +{{ end }} + + + + + +{{ with .Site.Params.twitterHandle }} + +{{ end }} + +{{/* SEO: Self-referencing canonical */}} + + +{{/* SEO: hreflang alternates for all language variants */}} +{{ range .AllTranslations }} + +{{ end }} +{{/* x-default: EN version (served at root /) */}} +{{ range .AllTranslations }} + {{ if eq .Language.Lang "en" }} + + {{ end }} +{{ end }} + +{{/* Structured data: BreadcrumbList JSON-LD (single pages and named sections) */}} +{{ if or (eq .Kind "page") (eq .Kind "section") }}{{ partial "breadcrumb-jsonld.html" . }}{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..914e645 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,94 @@ +
    + + + + {{ partial "hamburger-menu.html" . }} +
    diff --git a/layouts/partials/search-modal.html b/layouts/partials/search-modal.html new file mode 100644 index 0000000..6b96b3a --- /dev/null +++ b/layouts/partials/search-modal.html @@ -0,0 +1,87 @@ + +
    + + + + + +
    diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..a2225f1 --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,54 @@ + diff --git a/layouts/partials/social-share.html b/layouts/partials/social-share.html new file mode 100644 index 0000000..9e9be43 --- /dev/null +++ b/layouts/partials/social-share.html @@ -0,0 +1,123 @@ +{{ $page := .page }} +{{ $mode := .mode | default "sidebar" }} +{{ $url := $page.Permalink | urlquery }} +{{ $title := $page.Title | urlquery }} + +{{ $gridClass := "share-grid gap-1" }} +{{ if eq $mode "inline" }} + {{ $gridClass = "flex flex-wrap justify-center gap-1" }} +{{ end }} + + diff --git a/layouts/partials/tag-cloud.html b/layouts/partials/tag-cloud.html new file mode 100644 index 0000000..b896e8d --- /dev/null +++ b/layouts/partials/tag-cloud.html @@ -0,0 +1,90 @@ +{{/* tag-cloud.html + Reusable tag cloud partial for homepage, sidebar, and 404 pages. + + Params (dict): + page Page required โ€” calling page context (provides .Site.Taxonomies.tags, .Lang) + showCount bool optional โ€” show post count per tag (default true) + heading string optional โ€” heading text override (default: i18n "tagCloud") + headingLevel string optional โ€” h2|h3|p for non-widget mode (default "h2") + wrapInWidget bool optional โ€” wrap in .sidebar-widget for sidebar placement (default false) + maxTags int optional โ€” max tags to show, 0 = all (default 0) +*/}} + +{{- $page := .page -}} +{{- $showCount := .showCount | default true -}} +{{- $heading := .heading | default (i18n "tagCloud") -}} +{{- $headingLevel := .headingLevel -}} +{{- $wrapInWidget := .wrapInWidget | default false -}} +{{- $maxTags := .maxTags | default 0 -}} + +{{- $tags := $page.Site.Taxonomies.tags -}} + +{{/* Early exit if no tags */}} +{{- if $tags -}} + +{{/* Compute max count for continuous scaling */}} +{{- $maxCount := 0 -}} +{{- range $tags -}} + {{- if gt .Count $maxCount -}}{{- $maxCount = .Count -}}{{- end -}} +{{- end -}} + +{{/* Ordered tag list (descending by count) */}} +{{- $orderedTags := $tags.ByCount -}} +{{- if gt $maxTags 0 -}} + {{- $orderedTags = first $maxTags $orderedTags -}} +{{- end -}} + +{{/* Render based on placement mode */}} +{{- if $wrapInWidget -}} +