feat: add last updated component

chore: option to reverse pagination

chore: reverse pagination for blog entries

- fix space for "by" authors
This commit is contained in:
Xin
2023-08-09 22:36:20 +01:00
parent a7aa9fa1cb
commit ad3c607623
4 changed files with 20 additions and 9 deletions

View File

@ -0,0 +1,8 @@
{{ if site.Params.displayUpdatedDate }}
{{- with .Lastmod -}}
{{ $datetime := (time.Format "2006-01-02T15:04:05.000Z" .) }}
<div class="mt-12 mb-8 block text-xs text-gray-500 ltr:text-right rtl:text-left dark:text-gray-400">Last updated on <time datetime="{{ $datetime }}">{{ partial "utils/format-date" . }}</time></div>
{{- end -}}
{{ else }}
<div class="mt-16"></div>
{{ end }}

View File

@ -1,7 +1,9 @@
{{/* Article navigation on the footer of the article */}}
{{- $prev := .NextInSection -}}
{{- $next := .PrevInSection -}}
{{ $reversePagination := .Scratch.Get "reversePagination" | default false }}
{{- $prev := cond $reversePagination .PrevInSection .NextInSection -}}
{{- $next := cond $reversePagination .NextInSection .PrevInSection -}}
{{- if or $prev $next -}}
<div class="mb-8 flex items-center border-t pt-8 dark:border-neutral-800 contrast-more:border-neutral-400 dark:contrast-more:border-neutral-400 print:hidden">
{{- if $prev -}}