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

73 lines
2 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 }}
2023-02-25 21:20:01 +01:00
<div class="-mt-2 mb-20 flex items-center">
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
2023-02-25 21:20:01 +01:00
class="my-0 aspect-square w-16 rounded-full !bg-black/5 hover:animate-spin dark:!bg-black/80"
2022-07-24 17:57:13 +02:00
src="{{ $avatar_url }}"
2023-02-24 18:51:26 +01:00
alt="{{ site.Params.name | default site.Title }}"
2022-07-24 17:57:13 +02:00
/>
2022-07-19 20:21:00 +02:00
</div>
2022-07-18 17:36:39 +02:00
{{ end }}<!---->
{{ if site.Params.name }}
<div>
2023-02-25 21:20:01 +01:00
<h1 class="my-2.5 text-3xl font-bold">{{ site.Params.name }}</h1>
2022-07-24 17:57:13 +02:00
<div class="break-words">
2023-02-24 18:51:26 +01:00
{{ site.Params.bio | default (print `A 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>
2023-03-19 19:34:05 +01:00
<time class="text-sm opacity-60"
2022-11-15 01:06:02 +01:00
>{{ .Date | time.Format ":date_medium" }}</time
>
2023-02-24 18:18:10 +01:00
<a class="absolute inset-0 text-[0]" href="{{ .Permalink }}">{{ .Title }}</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 }}