Feat: add pin icon in home post list and add repost icon in section .etc.

This commit is contained in:
Cell
2023-12-27 16:30:36 +08:00
parent 0c3148b3ee
commit da54fef151
20 changed files with 96 additions and 51 deletions
+7 -1
View File
@@ -40,7 +40,13 @@
<h2 class="group-title">{{ .Key }}</h2>
{{- range .Pages -}}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .LinkTitle -}}</a>
<a href="{{ .RelPermalink }}" class="archive-item-link">
{{- $repost := .Params.repost | default dict -}}
{{- if eq $repost.enable true -}}
{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}}
{{- end -}}
{{- .LinkTitle -}}
</a>
<span class="archive-item-date" title='{{ "2006-01-02 15:04:05" | .Date.Format }}'>
{{- .Date | dateFormat ($.Site.Params.section.dateFormat | default "01-02") -}}
</span>
+5 -1
View File
@@ -19,7 +19,11 @@
{{- /* Title */ -}}
<h2 class="single-title" itemprop="name headline">
{{ $repost := $params.repost | default dict }}
{{- with $params.weight -}}
{{- $icon := dict "Class" "fa-solid fa-thumbtack fa-fw" -}}
<span title="{{ T "single.pin" }}" class="icon-pin">{{- $icon | partial "plugin/icon.html" -}}</span>
{{- end -}}
{{- $repost := $params.repost | default dict -}}
{{- with $repost -}}
{{- if eq .Enable true -}}
{{- $icon := dict "Class" "fa-solid fa-share fa-fw" -}}