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

79 lines
2.2 KiB
HTML
Raw Permalink 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") }}
2023-07-05 20:03:28 +02:00
<h1 class="mb-16">#{{ .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-07-05 20:03:28 +02:00
<div class="-mt-2 mb-16 flex items-center">
2022-07-18 17:36:39 +02:00
{{ if $avatar_url }}
2022-08-15 20:20:41 +02:00
<div
2023-07-05 20:03:28 +02:00
class="mr-5 shrink-0 rounded-full border-[0.5px] border-black/10 bg-white/50 p-3 shadow dark:bg-white/[15%]"
2022-08-15 20:20:41 +02:00
>
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-06-02 12:43:49 +02:00
<h1 class="mb-2 mt-3 text-[1.6rem] 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">
2023-05-20 21:20:31 +02:00
{{ if gt .Weight 0 }}
<span
2023-07-05 20:03:28 +02:00
class="mb-2 ml-px inline-block text-[0.8rem] font-medium uppercase tracking-wider text-[#ff3b2d] opacity-70"
2023-05-20 21:20:31 +02:00
>Featured</span
>
{{ end }}
2023-06-02 12:43:49 +02:00
<h2 class="!my-0 pb-1 font-bold !leading-none">{{ .Title }}</h2>
2023-07-05 20:03:28 +02:00
<time class="text-sm antialiased 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 }}
2023-07-07 10:38:46 +02:00
<nav class="mt-16 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 }}