💄 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
showReadingTime = true
[list]
groupByYear = true
[taxonomy]
showTermCount = true

View File

@ -6,7 +6,7 @@
<span>
{{ if .NextInSection }}
<a class="flex" href="{{ .NextInSection.Permalink }}">
<span class="mr-3"></span>
<span class="mr-3">&larr;</span>
<span class="flex flex-col">
<span class="button__text">{{ .NextInSection.Title }}</span>
{{ if .Site.Params.article.showDate | default true }}
@ -35,7 +35,7 @@
</time>
{{ end }}
</span>
<span class="ml-3"></span>
<span class="ml-3">&rarr;</span>
</a>
{{ end }}
</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 }}
<!-- If there's more than one page. -->
{{ if gt $paginator.TotalPages 1 }}
<ul class="Pagination">
<!-- Previous page. -->
<ul class="flex flex-row mt-8">
{{ if $paginator.HasPrev }}
<li class="Pagination-item Pagination-item--previous">
<li>
<a
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"
>
&larr;
</a>
</li>
{{ end }}
<!-- Page numbers. -->
{{ range $paginator.Pagers }}
<li
class="Pagination-item{{ if eq . $paginator }}
Pagination-item--current
{{ end }}"
>
<a href="{{ .URL }}" class="Pagination-itemLink"> {{ .PageNumber }} </a>
<li>
<a
href="{{ .URL }}"
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
{{ end }}"
>
{{ .PageNumber }}
</a>
</li>
{{ end }}
<!-- Next page. -->
{{ if $paginator.HasNext }}
<li class="Pagination-item Pagination-item--next">
<li>
<a
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"
>
&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>
<section>{{ .Content }}</section>
</section>

File diff suppressed because one or more lines are too long