Files
FixIt/layouts/_default/single.html
T
2024-08-26 11:22:45 +08:00

36 lines
1.4 KiB
HTML

{{- define "title" -}}
{{- title .Title -}}
{{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}}
{{- end -}}
{{- define "content" -}}
{{- $params := partial "function/params.html" -}}
<article class="page single special">
<div class="header">
{{- /* Title */ -}}
<h1 class="single-title animate__animated animate__pulse animate__faster">{{- title .Title -}}</h1>
{{- /* Subtitle */ -}}
{{- with $params.subtitle -}}<p class="single-subtitle animate__animated animate__fadeIn">{{ . }}</p>{{- end -}}
</div>
{{- /* Content */ -}}
{{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
{{- /* Content Encryption */ -}}
{{- $content = dict "Content" $content "Password" $params.password | partial "function/content-encryption.html" | safeHTML -}}
<div class="content" id="content"
{{- with $params.password }} data-password="{{ hash.XxHash . }}"{{ end }}
{{- with $params.password }} data-content="{{ $content }}"{{ end -}}
>
{{- if not $params.password -}}
{{- $content -}}
{{- else -}}
{{- partial "single/fixit-decryptor.html" . -}}
{{- end -}}
</div>
{{- /* Comment */ -}}
{{- partial "single/comment.html" . -}}
</article>
{{- end -}}