mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
feat(widget): add support to customize See All link in Featured widget
Documentation: https://github.com/wowchemy/wowchemy-hugo-modules/issues/1800#issuecomment-678817441
BREAKING CHANGE
Removes the old experimental option `content.link_to_archive`
Follows on from Pages widget implementation in 05bfd7c
See #1800
This commit is contained in:
1 parent
b634d637f1
commit
161cdb903e
1 file changed
+17
-3
@@ -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" }}
|
||||
|
||||
<div class="see-all">
|
||||
<a href="{{ $archive_page.RelPermalink }}">
|
||||
{{ i18n $i18n | default "See all" }}
|
||||
<a href="{{ $archive_link }}">
|
||||
{{ $archive_text | emojify }}
|
||||
<i class="fas fa-angle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user