feat: customize prev and next page link in the page footer
This commit is contained in:
@@ -62,11 +62,24 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-nav">
|
<div class="post-nav">
|
||||||
{{- if .PrevInSection -}}
|
{{- $prevPage := false -}}
|
||||||
<a href="{{ .PrevInSection.RelPermalink }}" class="prev" rel="prev" title="{{ .PrevInSection.Title }}"><i class="fas fa-angle-left fa-fw" aria-hidden="true"></i>{{ .PrevInSection.Title | emojify }}</a>
|
{{- $nextPage := false -}}
|
||||||
|
{{- if or (.Params.prev) (.Params.next) -}}
|
||||||
|
{{- with .Params.prev -}}
|
||||||
|
{{- $prevPage = $.Site.GetPage . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with .Params.next -}}
|
||||||
|
{{- $nextPage = $.Site.GetPage . -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $prevPage = .PrevInSection -}}
|
||||||
|
{{- $nextPage = .NextInSection -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ if .NextInSection }}
|
{{- with $prevPage -}}
|
||||||
<a href="{{ .NextInSection.RelPermalink }}" class="next" rel="next" title="{{ .NextInSection.Title }}">{{ .NextInSection.Title | emojify }}<i class="fas fa-angle-right fa-fw" aria-hidden="true"></i></a>
|
<a href="{{ .RelPermalink }}" class="prev" rel="prev" title="{{ .Title }}"><i class="fas fa-angle-left fa-fw" aria-hidden="true"></i>{{ .Title | emojify }}</a>
|
||||||
|
{{- end -}}
|
||||||
|
{{ with $nextPage }}
|
||||||
|
<a href="{{ .RelPermalink }}" class="next" rel="next" title="{{ .Title }}">{{ .Title | emojify }}<i class="fas fa-angle-right fa-fw" aria-hidden="true"></i></a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user