💄 Add styles for pagination links

pull/2/head
James Panther 2021-08-16 10:41:00 +10:00
parent d8473ba7d5
commit e293f4c509
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
5 changed files with 21 additions and 25 deletions

View File

@ -18,6 +18,9 @@
showPagination = true showPagination = true
showReadingTime = true showReadingTime = true
[list]
groupByYear = true
[taxonomy] [taxonomy]
showTermCount = true showTermCount = true

View File

@ -6,7 +6,7 @@
<span> <span>
{{ if .NextInSection }} {{ if .NextInSection }}
<a class="flex" href="{{ .NextInSection.Permalink }}"> <a class="flex" href="{{ .NextInSection.Permalink }}">
<span class="mr-3"></span> <span class="mr-3">&larr;</span>
<span class="flex flex-col"> <span class="flex flex-col">
<span class="button__text">{{ .NextInSection.Title }}</span> <span class="button__text">{{ .NextInSection.Title }}</span>
{{ if .Site.Params.article.showDate | default true }} {{ if .Site.Params.article.showDate | default true }}
@ -35,7 +35,7 @@
</time> </time>
{{ end }} {{ end }}
</span> </span>
<span class="ml-3"></span> <span class="ml-3">&rarr;</span>
</a> </a>
{{ end }} {{ end }}
</span> </span>

View File

@ -1,41 +1,34 @@
<!-- See: https://glennmccomb.com/articles/how-to-build-custom-hugo-pagination/ -->
<!-- Assign .Paginator object to a $paginator variable -->
{{ $paginator := .Paginator }} {{ $paginator := .Paginator }}
<!-- If there's more than one page. -->
{{ if gt $paginator.TotalPages 1 }} {{ if gt $paginator.TotalPages 1 }}
<ul class="Pagination"> <ul class="flex flex-row mt-8">
<!-- Previous page. -->
{{ if $paginator.HasPrev }} {{ if $paginator.HasPrev }}
<li class="Pagination-item Pagination-item--previous"> <li>
<a <a
href="{{ $paginator.Prev.URL }}" href="{{ $paginator.Prev.URL }}"
class="Pagination-itemLink Pagination-itemLink--previous" class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded"
rel="prev" rel="prev"
> >
&larr; &larr;
</a> </a>
</li> </li>
{{ end }} {{ end }}
<!-- Page numbers. -->
{{ range $paginator.Pagers }} {{ range $paginator.Pagers }}
<li <li>
class="Pagination-item{{ if eq . $paginator }} <a
Pagination-item--current href="{{ .URL }}"
{{ end }}" class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded {{ if eq . $paginator }}
> bg-primary-200 dark:bg-primary-400 dark:text-gray-800
<a href="{{ .URL }}" class="Pagination-itemLink"> {{ .PageNumber }} </a> {{ end }}"
>
{{ .PageNumber }}
</a>
</li> </li>
{{ end }} {{ end }}
<!-- Next page. -->
{{ if $paginator.HasNext }} {{ if $paginator.HasNext }}
<li class="Pagination-item Pagination-item--next"> <li>
<a <a
href="{{ $paginator.Next.URL }}" href="{{ $paginator.Next.URL }}"
class="Pagination-itemLink Pagination-itemLink--next" class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded"
rel="next" rel="next"
> >
&rarr; &rarr;

View File

@ -1,4 +1,4 @@
<section class="prose"> <section class="prose dark:prose-light">
<h1 class="mb-3 text-4xl font-extrabold">{{ .Title }}</h1> <h1 class="mb-3 text-4xl font-extrabold">{{ .Title }}</h1>
<section>{{ .Content }}</section> <section>{{ .Content }}</section>
</section> </section>

File diff suppressed because one or more lines are too long