🏗️ Finish post reward widget coding.

This commit is contained in:
凡梦星尘
2022-06-04 16:15:35 +08:00
parent df06c05c4e
commit 109a749260
11 changed files with 64 additions and 11 deletions

View File

@@ -9,8 +9,9 @@
{{- end }}
<div class="post-eof"></div>
{{- else }}
{{ partial "post/post_copyright.html" . }}
{{ partial "post/post_followme.html" . }}
{{ partial "post/post_footer/post_reward.html" . }}
{{ partial "post/post_footer/post_copyright.html" . }}
{{ partial "post/post_footer/post_followme.html" . }}
<div class="post-nav">
<div class="post-nav-next post-nav-item">
{{- with .NextInSection }}

View File

@@ -0,0 +1,21 @@
{{- with .Site.Params.rewardSets }}
{{- if .enable }}
<div class="reward-container">
<div>{{- .comment | safeHTML -}}</div>
<button>
{{- T "RewardDonate" -}}
</button>
<div class="post-reward">
{{- range $name,$img := $.Site.Params.reward }}
{{- $fw := substr $name 0 1 }}
{{- $pay := replace $name $fw ($fw | upper) 1 }}
{{- $payName := T (printf "Reward%s" $pay) }}
<div class="post-reward-item">
<img src="{{ $img }}" alt="{{ $.Site.Params.author }} - {{ $payName }}">
<span>{{ $payName }}</span>
</div>
{{- end }}
</div>
</div>
{{- end }}
{{- end }}