1
0
Fork 0
hugo-paper/layouts/_default/list.html

72 lines
1.9 KiB
HTML
Raw Normal View History

2021-08-23 21:59:02 +02:00
{{ define "main" }}
2019-03-31 14:32:06 +02:00
2022-07-24 17:57:13 +02:00
<!-- Tag Title -->
{{ if and .Title (eq .Type "tags") }}
2022-07-19 17:25:41 +02:00
<h1 class="mb-24">{{ .Title }}</h1>
2020-03-09 18:50:02 +01:00
{{ end }}
2020-03-09 16:56:13 +01:00
2021-08-23 21:59:02 +02:00
<!-- $pages -->
2022-07-18 17:36:39 +02:00
{{ $pages := union .RegularPages .Sections }}<!---->
{{ if .IsHome }}<!---->
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
2021-08-20 13:21:20 +02:00
{{ end }}
2019-03-31 14:32:06 +02:00
2021-08-23 21:59:02 +02:00
<!-- Articles -->
2022-11-15 01:06:02 +01:00
{{ $paginator := .Paginate $pages }} {{ range $index, $page := $paginator.Pages
}}<!---->
2022-07-18 17:36:39 +02:00
<!-- avatar -->
{{ if and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) }}<!---->
2022-08-15 20:20:41 +02:00
{{ $avatar_url := $.Scratch.Get "avatar_url" }}<!---->
2022-07-18 17:36:39 +02:00
{{ if or $avatar_url site.Params.name }}
2022-07-24 17:57:13 +02:00
<div class="-mt-4 mb-20 flex items-start">
2022-07-18 17:36:39 +02:00
{{ if $avatar_url }}
2022-08-15 20:20:41 +02:00
<div
class="mr-5 shrink-0 rounded-full border-[0.5px] border-black/10 bg-white/50 p-3 shadow-xl dark:bg-white/80"
>
2022-07-24 17:57:13 +02:00
<img
class="my-0 h-14 w-14 rounded-full !bg-black/5 hover:animate-spin dark:!bg-black/80"
src="{{ $avatar_url }}"
/>
2022-07-19 20:21:00 +02:00
</div>
2022-07-18 17:36:39 +02:00
{{ end }}<!---->
{{ if site.Params.name }}
<div>
2022-07-24 17:57:13 +02:00
<h1 class="mt-1.5 mb-3 text-3xl font-bold">{{ site.Params.name }}</h1>
<div class="break-words">
2022-11-15 01:06:02 +01:00
{{ site.Params.bio | default (print "Personal blog by " site.Params.name)
}}
2022-07-24 17:57:13 +02:00
</div>
2022-07-18 17:36:39 +02:00
</div>
{{ end }}
</div>
{{ end }}<!---->
{{ end }}
2022-07-24 17:57:13 +02:00
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0">
2022-07-18 17:36:39 +02:00
<h2 class="!my-0 pb-1 !leading-none">{{ .Title }}</h2>
2022-11-15 01:06:02 +01:00
<time class="text-sm opacity-60"
>{{ .Date | time.Format ":date_medium" }}</time
>
2022-07-18 17:36:39 +02:00
<a class="absolute inset-0" href="{{ .Permalink }}"></a>
2022-07-24 17:57:13 +02:00
</section>
2021-08-20 13:21:20 +02:00
{{ end }}
2019-03-31 14:32:06 +02:00
2021-08-23 21:59:02 +02:00
<!-- Main Nav -->
2021-08-20 13:21:20 +02:00
{{ if gt $paginator.TotalPages 1 }}
2022-07-19 17:25:41 +02:00
<nav class="mt-24 flex">
2021-08-20 13:21:20 +02:00
{{ if $paginator.HasPrev }}
2022-07-18 17:36:39 +02:00
<a class="btn" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
2021-08-23 21:59:02 +02:00
{{ end }}<!---->
2021-08-20 13:21:20 +02:00
{{ if $paginator.HasNext }}
2022-11-15 01:06:02 +01:00
<a class="btn ml-auto" href="{{ $paginator.Next.URL }}"
>{{ i18n "next_page" }} →</a
>
2021-08-20 13:21:20 +02:00
{{ end }}
</nav>
2021-08-23 21:59:02 +02:00
{{ end }}<!---->
2019-03-31 14:32:06 +02:00
2021-08-23 21:59:02 +02:00
{{ end }}