{{ if .PrevInSection | or .NextInSection }} {{ $segments := split .RelPermalink "/" }} {{ $subsection := index $segments 2 }}
{{ if .NextInSection }} {{ $nextSubsection := index (split .NextInSection.RelPermalink "/") 2 }} {{ if eq $nextSubsection $subsection }}
Previous
{{ end }} {{ end }}
{{ if .PrevInSection }} {{ $prevSubsection := index (split .PrevInSection.RelPermalink "/") 2 }} {{ if eq $prevSubsection $subsection }} {{ end }} {{ end }}
{{ end }}