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/article-nav.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/article-nav.html')
| -rw-r--r-- | layouts/partials/article-nav.html | 46 |
1 files changed, 46 insertions, 0 deletions
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 }} + +<nav class="article-nav {{ if eq $variant "bottom" }}mt-8{{ else }}mb-8{{ end }}" + aria-label="Article navigation"> + <p class="article-nav-prompt" aria-hidden="true"> + [visitor@danix.xyz articles]$ {{ $cmd }} + </p> + <div class="article-nav-links"> + {{/* ---- Previous (left side) ---- */}} + {{ if $prev }} + <a href="{{ $prev.Permalink }}" + class="article-nav-link truncate md:max-w-[45%] text-left" + rel="prev" + title="{{ $prev.Title }}"> + ◄ {{ $prev.Title }} + </a> + {{ else }} + <span class="article-nav-placeholder text-left" aria-label="Beginning of articles"> + ◄ (beginning) + </span> + {{ end }} + + {{/* ---- Next (right side) ---- */}} + {{ if $next }} + <a href="{{ $next.Permalink }}" + class="article-nav-link truncate md:max-w-[45%] text-right" + rel="next" + title="{{ $next.Title }}"> + {{ $next.Title }} ► + </a> + {{ else }} + <span class="article-nav-placeholder text-right" aria-label="End of articles"> + (end) ► + </span> + {{ end }} + </div> +</nav> |
