simplify condition

This commit is contained in:
Aditya Telange 2023-11-04 10:26:36 +05:30
parent c82cdcdc2c
commit 38e137066a
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77

View File

@ -14,7 +14,7 @@
{{- with $ShareButtons }}{{ $custom = true }}{{ end }} {{- with $ShareButtons }}{{ $custom = true }}{{ end }}
<div class="share-buttons"> <div class="share-buttons">
{{- if (cond ($custom) (in $ShareButtons "x") (true)) | or (cond ($custom) (in $ShareButtons "twitter") (true)) }} {{- if (or (cond ($custom) (in $ShareButtons "x") (true)) (cond ($custom) (in $ShareButtons "twitter") (true))) }}
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on x" <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on x"
href="https://x.com/intent/tweet/?text={{ $title }}&amp;url={{ $pageurl }}&amp;hashtags={{- $.Scratch.Get "tags" -}}"> href="https://x.com/intent/tweet/?text={{ $title }}&amp;url={{ $pageurl }}&amp;hashtags={{- $.Scratch.Get "tags" -}}">
<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor">
@ -68,4 +68,4 @@
</svg> </svg>
</a> </a>
{{- end }} {{- end }}
</div> </div>