mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 02:46:16 +01:00
feat: customize prev and next page link in the page footer
This commit is contained in:
parent
d2d66e5163
commit
4b24331134
1 changed files with 17 additions and 4 deletions
|
@ -62,11 +62,24 @@
|
|||
</div>
|
||||
|
||||
<div class="post-nav">
|
||||
{{- if .PrevInSection -}}
|
||||
<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>
|
||||
{{- $prevPage := false -}}
|
||||
{{- $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 -}}
|
||||
{{ if .NextInSection }}
|
||||
<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>
|
||||
{{- with $prevPage -}}
|
||||
<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 -}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue