mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-02-06 11:53:31 +08:00
feat(widgets): change widget icon or make it invisible. (#1120)
User can disable icon using `widgets.[home]page.iconVisible`, and change widget icon using `widgets.[home]page.icon`.
This commit is contained in:
parent
9e6b7b22a9
commit
787425b911
@ -5,7 +5,11 @@
|
|||||||
{{- $archivesPage := index $query 0 -}}
|
{{- $archivesPage := index $query 0 -}}
|
||||||
<section class="widget archives">
|
<section class="widget archives">
|
||||||
<div class="widget-icon">
|
<div class="widget-icon">
|
||||||
{{ partial "helper/icon" "infinity" }}
|
{{ $icon := default "infinity" .Params.icon }}
|
||||||
|
{{ $iconVisible := default true .Params.iconVisible }}
|
||||||
|
{{ if $iconVisible }}
|
||||||
|
{{ partial "helper/icon" $icon }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
|
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
|
||||||
|
|
||||||
|
@ -2,7 +2,11 @@
|
|||||||
{{- $limit := default 10 .Params.limit -}}
|
{{- $limit := default 10 .Params.limit -}}
|
||||||
<section class="widget tagCloud">
|
<section class="widget tagCloud">
|
||||||
<div class="widget-icon">
|
<div class="widget-icon">
|
||||||
{{ partial "helper/icon" "categories" }}
|
{{ $icon := default "categories" .Params.icon }}
|
||||||
|
{{ $iconVisible := default true .Params.iconVisible }}
|
||||||
|
{{ if $iconVisible }}
|
||||||
|
{{ partial "helper/icon" $icon }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<h2 class="widget-title section-title">{{ T "widget.categoriesCloud.title" }}</h2>
|
<h2 class="widget-title section-title">{{ T "widget.categoriesCloud.title" }}</h2>
|
||||||
|
|
||||||
|
@ -2,7 +2,11 @@
|
|||||||
{{- $limit := default 10 .Params.limit -}}
|
{{- $limit := default 10 .Params.limit -}}
|
||||||
<section class="widget tagCloud">
|
<section class="widget tagCloud">
|
||||||
<div class="widget-icon">
|
<div class="widget-icon">
|
||||||
{{ partial "helper/icon" "tag" }}
|
{{ $icon := default "tag" .Params.icon }}
|
||||||
|
{{ $iconVisible := default true .Params.iconVisible }}
|
||||||
|
{{ if $iconVisible }}
|
||||||
|
{{ partial "helper/icon" $icon }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<h2 class="widget-title section-title">{{ T "widget.tagCloud.title" }}</h2>
|
<h2 class="widget-title section-title">{{ T "widget.tagCloud.title" }}</h2>
|
||||||
|
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
{{ if (.Context.Scratch.Get "TOCEnabled") }}
|
{{ if (.Context.Scratch.Get "TOCEnabled") }}
|
||||||
<section class="widget archives">
|
<section class="widget archives">
|
||||||
<div class="widget-icon">
|
<div class="widget-icon">
|
||||||
{{ partial "helper/icon" "hash" }}
|
{{ $icon := default "hash" .Params.icon }}
|
||||||
|
{{ $iconVisible := default true .Params.iconVisible }}
|
||||||
|
{{ if $iconVisible }}
|
||||||
|
{{ partial "helper/icon" $icon }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<h2 class="widget-title section-title">{{ T "article.tableOfContents" }}</h2>
|
<h2 class="widget-title section-title">{{ T "article.tableOfContents" }}</h2>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user