mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
33 lines
1.2 KiB
HTML
33 lines
1.2 KiB
HTML
{{- $password := "" -}}
|
|
{{- $message := "" -}}
|
|
|
|
{{- if .IsNamedParams -}}
|
|
{{- $password = .Get "password" | default "" -}}
|
|
{{- $message = .Get "message" | default (T "single.encryptedMessage") -}}
|
|
{{- else -}}
|
|
{{- $password = .Get 0 | default "" -}}
|
|
{{- $message = .Get 1 | default (T "single.encryptedMessage") -}}
|
|
{{- end -}}
|
|
|
|
{{- if $password -}}
|
|
{{- /* Content */ -}}
|
|
{{- $content := .Inner | .Page.RenderString -}}
|
|
{{- /* Content Encryption */ -}}
|
|
{{- $content = dict "Content" $content "Password" $password | partial "function/content-encryption.html" | safeHTML -}}
|
|
|
|
<fixit-encryptor class="fixit-encryptor-shortcode">
|
|
<div class="fixit-decryptor-container">
|
|
<label title='{{ T "single.password" }}'>
|
|
<input type="password" class="fixit-decryptor-input" placeholder="🔑 {{ $message }}" />
|
|
</label>
|
|
<button class="fixit-decryptor-btn">
|
|
{{- dict "Class" "fa-solid fa-unlock" | partial "plugin/icon.html" }} {{ T "single.enterBtn" -}}
|
|
</button>
|
|
</div>
|
|
<div data-password="{{ xxhash $password }}" data-content="{{ $content }}"></div>
|
|
</fixit-encryptor>
|
|
{{- .Page.Scratch.SetInMap "this" "encryptPartial" true -}}
|
|
{{- else -}}
|
|
{{- .Inner -}}
|
|
{{- end -}}
|