diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-22 12:42:56 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-22 12:42:56 +0200 |
| commit | 631547a75142326a7c71bdf123e1475217a5ad73 (patch) | |
| tree | f3cfef6b3c5b42bf626fc823ddcf63b8dcf4cdbb /layouts/partials/sidebar.html | |
| parent | 77ccbe72fad5a4870185fff374f75471c16a9043 (diff) | |
| download | danixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.tar.gz danixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.zip | |
chore: replace with extracted danix.xyz-hacker theme (danix2-hugo-theme)
Diffstat (limited to 'layouts/partials/sidebar.html')
| -rw-r--r-- | layouts/partials/sidebar.html | 54 |
1 files changed, 54 insertions, 0 deletions
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 @@ +<aside class="order-last md:order-none md:col-span-1"> + <!-- Author info widget (optional - can be expanded) --> + <div class="sidebar-widget"> + <p class="sidebar-widget-label"># {{ i18n "author" }}</p> + <p class="text-text-dim text-sm leading-relaxed"> + {{ .Site.Params.author }} + </p> + </div> + + <hr class="sidebar-hr"> + + <!-- Social sharing widget --> + {{ partial "social-share.html" (dict "page" . "mode" "sidebar") }} + + <!-- Related posts widget (articles only) --> + {{ if and .Site.Params.relatedPosts (eq .Section "articles") }} + {{ $related := first 5 (.Site.RegularPages.Related .) }} + <hr class="sidebar-hr"> + <div class="sidebar-widget"> + <p class="sidebar-widget-label"># {{ i18n "relatedPosts" }}</p> + {{ if $related }} + <ul class="space-y-3"> + {{ range $related }} + {{ $articleType := .Params.type | default "life" }} + {{ $excerpt := .Description | default .Summary }} + <li + class="pl-3 border-l-2" + style="border-color: var(--type-{{ $articleType }});" + > + <a href="{{ .RelPermalink }}" class="text-sm hover:text-accent transition-colors leading-snug block"> + {{ .Title }} + <time class="text-text-dim/60 ml-1" datetime="{{ .PublishDate.Format "2006-01-02T15:04:05Z07:00" }}"> + · {{ .PublishDate.Format "Jan 2006" }} + </time> + </a> + {{ if $excerpt }} + <p class="text-xs text-text-dim/70 leading-snug mt-0.5 line-clamp-1"> + {{ $excerpt | plainify | truncate 60 }} + </p> + {{ end }} + </li> + {{ end }} + </ul> + {{ else }} + <p class="text-sm text-text-dim">{{ i18n "noRelated" }}</p> + {{ end }} + </div> + {{ end }} + + <hr class="sidebar-hr"> + + <!-- Tag Cloud Widget --> + {{ partial "tag-cloud.html" (dict "page" . "showCount" false "wrapInWidget" true "maxTags" 15) }} +</aside> |
