2021-08-23 21:59:02 +02:00
|
|
|
{{ define "main" }}
|
2019-03-31 14:32:06 +02:00
|
|
|
|
2021-08-23 21:59:02 +02:00
|
|
|
<!-- Main Title -->
|
2021-08-20 13:21:20 +02:00
|
|
|
{{ if .Title }}
|
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-07-18 17:36:39 +02:00
|
|
|
{{ $paginator := .Paginate $pages }} {{ range $index, $page := $paginator.Pages }}<!---->
|
|
|
|
|
|
|
|
<!-- avatar -->
|
|
|
|
{{ if and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) }}<!---->
|
|
|
|
|
|
|
|
{{ $avatar_url := $.Scratch.Get `avatar_url` }}<!---->
|
|
|
|
{{ if or $avatar_url site.Params.name }}
|
2022-07-19 17:25:41 +02:00
|
|
|
<div class="-mt-4 mb-20 flex">
|
2022-07-18 17:36:39 +02:00
|
|
|
{{ if $avatar_url }}
|
|
|
|
<img
|
2022-07-19 17:25:41 +02:00
|
|
|
class="my-0 mr-5 !h-20 !w-20 rounded-full border border-black/10 bg-white/80 p-3 shadow-xl"
|
2022-07-18 17:36:39 +02:00
|
|
|
src="{{ $avatar_url }}"
|
|
|
|
alt="avatar"
|
|
|
|
/>
|
|
|
|
{{ end }}<!---->
|
|
|
|
{{ if site.Params.name }}
|
|
|
|
<div>
|
2022-07-19 17:25:41 +02:00
|
|
|
<h1 class="mt-1 mb-3 text-3xl font-bold">{{ site.Params.name }}</h1>
|
|
|
|
<div class="">{{ site.Params.bio | default (print "Personal blog by " site.Params.name) }}</div>
|
2022-07-18 17:36:39 +02:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}<!---->
|
|
|
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
<article class="relative my-10 first-of-type:mt-0 last-of-type:mb-0">
|
|
|
|
<h2 class="!my-0 pb-1 !leading-none">{{ .Title }}</h2>
|
2022-07-19 17:25:41 +02:00
|
|
|
<time class="text-sm opacity-70">{{ .Date | time.Format ":date_medium" }}</time>
|
2022-07-18 17:36:39 +02:00
|
|
|
<a class="absolute inset-0" href="{{ .Permalink }}"></a>
|
2018-01-08 17:28:39 +01:00
|
|
|
</article>
|
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-07-18 17:36:39 +02: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 }}
|