diff --git a/wowchemy/layouts/partials/widgets/featured.html b/wowchemy/layouts/partials/widgets/featured.html index 8e561946..a9b5c096 100644 --- a/wowchemy/layouts/partials/widgets/featured.html +++ b/wowchemy/layouts/partials/widgets/featured.html @@ -29,6 +29,8 @@ {{ $query = $query | intersect $archive_page.Pages }} {{ end }} +{{ $count := len $query }} + {{/* Sort */}} {{ $sort_by := "Date" }} {{ $query = sort $query $sort_by $items_sort }} @@ -66,10 +68,22 @@ {{ end }} {{end}} - {{ if $st.Params.content.link_to_archive }} + {{/* Archive link */}} + {{ $show_archive_link := $st.Params.content.archive.enable | default (gt $count $items_count) }} + {{ if $show_archive_link }} + + {{ $archive_link := "" }} + {{ if $st.Params.content.archive.link }} + {{ $archive_link = $st.Params.content.archive.link | relLangURL }} + {{ else }} + {{ $archive_link = $archive_page.RelPermalink }} + {{ end }} + + {{ $archive_text := $st.Params.content.archive.text | default (i18n $i18n) | default "See all" }} +