Do not unique-by-series when a flag is set
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -18,10 +18,12 @@
|
|||||||
{{- if .linkSeries -}}
|
{{- if .linkSeries -}}
|
||||||
{{- $term := index (.page.GetTerms "series") 0 -}}
|
{{- $term := index (.page.GetTerms "series") 0 -}}
|
||||||
{{- with $term -}}
|
{{- with $term -}}
|
||||||
|
{{- if (not ($term.Param "donotunique")) -}}
|
||||||
<div class="series-link">
|
<div class="series-link">
|
||||||
{{- partial "icon.html" "corner-down-right" -}}
|
{{- partial "icon.html" "corner-down-right" -}}
|
||||||
<p>{{- i18n "latestInSeries" }} <a href="{{ $term.Permalink }}">{{ $term.Title }}</a></p>
|
<p>{{- i18n "latestInSeries" }} <a href="{{ $term.Permalink }}">{{ $term.Title }}</a></p>
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{{- $tmpScratch := newScratch -}}
|
{{- $tmpScratch := newScratch -}}
|
||||||
{{- range $post := (where (where site.Pages.ByDate.Reverse "Section" "blog") ".Kind" "!=" "section") -}}
|
{{- range $post := (where (where site.Pages.ByDate.Reverse "Section" "blog") ".Kind" "!=" "section") -}}
|
||||||
{{- $term := index ($post.GetTerms "series") 0 -}}
|
{{- $term := index ($post.GetTerms "series") 0 -}}
|
||||||
{{- if $term -}}
|
{{- if (and $term (not ($term.Param "donotunique"))) -}}
|
||||||
{{- if not ($tmpScratch.Get $term.Permalink) -}}
|
{{- if not ($tmpScratch.Get $term.Permalink) -}}
|
||||||
{{- $tmpScratch.Set $term.Permalink true -}}
|
{{- $tmpScratch.Set $term.Permalink true -}}
|
||||||
{{- $scratch.Add "pages" $post -}}
|
{{- $scratch.Add "pages" $post -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user