Skip to content

Commit

Permalink
Add parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
egeorjon committed Apr 11, 2021
1 parent dd3274e commit 460e35a
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions layouts/partials/widgets/series.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
{{- $widget := .widget | default true -}}
{{- $limit := .limit | default 5 -}}
{{- if isset .context.Site.Taxonomies "series" -}}
{{- if not (eq (len .context.Site.Taxonomies.tags) 0) -}}
{{- if eq $widget true -}}
<aside class="col widget widget-series">
<div class="widget-inner">
<h3>{{- i18n "series" -}}</h3>
{{- end -}}
<ul>
{{- $nb_series := 4 -}}
{{- $initial_limit := $limit -}}
{{- range .context.Site.Taxonomies.series -}}
{{- if gt $nb_series 0 }}
{{- if gt $limit 0 }}
<li><a href="{{- .Page.Permalink -}}" title="{{- .Page.Description -}}">{{- .Page.Title -}}</a> ({{- .Count -}})</li>
{{- $nb_series = sub $nb_series 1 -}}
{{- $limit = sub $limit 1 -}}
{{- end -}}
{{- end -}}
{{ with .context.Site.GetPage "series" -}}
<li><a href="{{- .RelPermalink -}}" title="{{- i18n "see-all-series" -}}">{{- i18n "all-series" -}}</a></li>
{{- end }}
{{- if gt (len .context.Site.Taxonomies.series) $initial_limit -}}
{{ with .context.Site.GetPage "series" -}}
<li><a href="{{- .RelPermalink -}}" title="{{- i18n "see-all-series" -}}">{{- i18n "all-series" -}}</a></li>
{{- end }}
{{- end -}}
</ul>
{{- if eq $widget true -}}
</div>
</aside>
{{- end -}}
{{- end -}}
{{- end -}}

0 comments on commit 460e35a

Please sign in to comment.