redesign 2023
This commit is contained in:
343
themes/FixIt/layouts/partials/single/comment.html
Normal file
343
themes/FixIt/layouts/partials/single/comment.html
Normal file
@ -0,0 +1,343 @@
|
||||
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
|
||||
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
||||
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
||||
{{- $commentConfig := dict "enable" false -}}
|
||||
|
||||
{{- if $comment.enable -}}
|
||||
{{- $commentConfig = dict "enable" true "expired" (.Scratch.Get "commentExpired" | default false) -}}
|
||||
<div id="comments">
|
||||
{{- /* Artalk Comment System */ -}}
|
||||
{{- $artalk := $comment.artalk | default dict -}}
|
||||
{{- if $artalk.enable -}}
|
||||
<div id="artalk" class="comment"></div>
|
||||
{{- $source := $cdn.artalkCSS | default "lib/artalk/Artalk.css" -}}
|
||||
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $source := $cdn.artalkJS | default "lib/artalk/Artalk.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $commentConfig = dict "el" "#artalk" "pageKey" .Permalink "pageTitle" .Title "pvEl" "artalk-visitor-count" "countEl" "artalk-comment-count" | dict "artalk" | merge $commentConfig -}}
|
||||
{{- if (eq $artalk.locale "") | and (eq $.Site.LanguageCode "en") -}}
|
||||
{{- $artalk = dict "locale" "en-US" | merge $artalk -}}
|
||||
{{- end -}}
|
||||
{{- $commentConfig = dict "locale" ($artalk.locale | default $.Site.LanguageCode | default "auto") | dict "artalk" | merge $commentConfig -}}
|
||||
{{- with .Site.Params.gravatar -}}
|
||||
{{- $commentConfig = dict "mirror" .Host "default" .Style | dict "gravatar" | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.server -}}
|
||||
{{- $commentConfig = dict "server" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.site -}}
|
||||
{{- $commentConfig = dict "site" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.placeholder -}}
|
||||
{{- $commentConfig = dict "placeholder" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.nocomment -}}
|
||||
{{- $commentConfig = dict "noComment" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.sendbtn -}}
|
||||
{{- $commentConfig = dict "sendBtn" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.editortravel -}}
|
||||
{{- $commentConfig = dict "editorTravel" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- if ne $artalk.flatmode nil -}}
|
||||
{{- $commentConfig = dict "flatMode" $artalk.flatmode | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.nestmax -}}
|
||||
{{- $commentConfig = dict "nestMax" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.nestsort -}}
|
||||
{{- $commentConfig = dict "nestSort" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.lightgallery -}}
|
||||
{{- $commentConfig = dict "lightgallery" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- if eq $artalk.vote false -}}
|
||||
{{- $commentConfig = dict "vote" false | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $artalk.votedown -}}
|
||||
{{- $commentConfig = dict "voteDown" . | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- if eq $artalk.uabadge false -}}
|
||||
{{- $commentConfig = dict "uaBadge" false | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- if eq $artalk.listsort false -}}
|
||||
{{- $commentConfig = dict "listSort" false | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- if eq $artalk.imgupload false -}}
|
||||
{{- $commentConfig = dict "imgUpload" false | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- if eq $artalk.preview false -}}
|
||||
{{- $commentConfig = dict "preview" false | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- if eq $artalk.versioncheck false -}}
|
||||
{{- $commentConfig = dict "versionCheck" false | dict "artalk" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://github.com/ArtalkJS/Artalk" rel="external nofollow noopener noreferrer">Artalk</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Disqus Comment System */ -}}
|
||||
{{- $disqus := $comment.disqus | default dict -}}
|
||||
{{- if $disqus.enable -}}
|
||||
<div id="disqus_thread" class="comment"></div>
|
||||
{{- $source := printf "https://%v.disqus.com/embed.js" $disqus.shortname -}}
|
||||
{{- dict "Source" $source "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://disqus.com/?ref_noscript" rel="external nofollow noopener noreferrer">Disqus</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Gitalk Comment System */ -}}
|
||||
{{- $gitalk := $comment.gitalk | default dict -}}
|
||||
{{- if $gitalk.enable -}}
|
||||
<div id="gitalk" class="comment"></div>
|
||||
{{- $source := $cdn.gitalkCSS | default "lib/gitalk/gitalk.css" -}}
|
||||
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $source := $cdn.gitalkJS | default "lib/gitalk/gitalk.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $commentConfig = dict "id" .Date "title" .Title "clientID" $gitalk.clientId "clientSecret" $gitalk.clientSecret "repo" $gitalk.repo "owner" $gitalk.owner "admin" (slice $gitalk.owner) | dict "gitalk" | merge $commentConfig -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://github.com/gitalk/gitalk" rel="external nofollow noopener noreferrer">Gitalk</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Valine Comment System */ -}}
|
||||
{{- $valine := $comment.valine | default dict -}}
|
||||
{{- if $valine.enable -}}
|
||||
<div id="valine" class="comment"></div>
|
||||
{{- $options := dict "targetPath" "lib/valine/valine.min.css" -}}
|
||||
{{- dict "Source" "lib/valine/valine.scss" "ToCSS" $options | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $source := $cdn.valineJS | default "lib/valine/Valine.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $commentConfig = dict "el" "#valine" "appId" $valine.appId "appKey" $valine.appKey "lang" ($valine.lang | default (T "valineLang")) "visitor" $valine.visitor "recordIP" $valine.recordIP "placeholder" ($valine.placeholder | default (T "comment.valinePlaceholder")) "highlight" (ne $valine.highlight false) "enableQQ" $valine.enableQQ | dict "valine" | merge $commentConfig -}}
|
||||
{{- with $valine.avatar -}}
|
||||
{{- $commentConfig = dict "avatar" . | dict "valine" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $valine.meta -}}
|
||||
{{- $commentConfig = dict "meta" . | dict "valine" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $valine.requiredFields -}}
|
||||
{{- $commentConfig = dict "requiredFields" . | dict "valine" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $valine.pageSize -}}
|
||||
{{- $commentConfig = dict "pageSize" . | dict "valine" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $valine.serverURLs -}}
|
||||
{{- $commentConfig = dict "serverURLs" . | dict "valine" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- $commentConfig = $valine.emoji | default "google.yml" | printf "lib/valine/emoji/%v" | resources.Get | transform.Unmarshal | dict "valine" | merge $commentConfig -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://valine.js.org/" rel="external nofollow noopener noreferrer">Valine</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Waline Comment System */ -}}
|
||||
{{- /* see https://waline.js.org/reference/component.html */ -}}
|
||||
{{- $waline := $comment.waline | default dict -}}
|
||||
{{- if $waline.enable -}}
|
||||
<div id="waline" class="comment"></div>
|
||||
{{- $source := $cdn.walineCSS | default "lib/waline/waline.css" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $source := $cdn.walineJS | default "lib/waline/waline.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $commentConfig = dict "el" "#waline" "serverURL" $waline.serverURL "lang" .Lang "dark" "body[data-theme='dark']" | dict "waline" | merge $commentConfig -}}
|
||||
{{- $commentConfig = dict "copyright" true "imageUploader" false "highlighter" false "texRenderer" false "search" false | dict "waline" | merge $commentConfig -}}
|
||||
{{- with $waline.pageview -}}
|
||||
{{- $commentConfig = dict "pageview" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.emoji -}}
|
||||
{{- $commentConfig = dict "emoji" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.meta -}}
|
||||
{{- $commentConfig = dict "meta" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.requiredMeta -}}
|
||||
{{- $commentConfig = dict "requiredMeta" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.login -}}
|
||||
{{- $commentConfig = dict "login" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.wordLimit -}}
|
||||
{{- $commentConfig = dict "wordLimit" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.pageSize -}}
|
||||
{{- $commentConfig = dict "pageSize" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.imageUploader -}}
|
||||
{{- $commentConfig = dict "imageUploader" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.highlighter -}}
|
||||
{{- $commentConfig = dict "highlighter" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.comment -}}
|
||||
{{- $commentConfig = dict "comment" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.texRenderer -}}
|
||||
{{- $commentConfig = dict "texRenderer" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.search -}}
|
||||
{{- $commentConfig = dict "search" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.recaptchaV3Key -}}
|
||||
{{- $commentConfig = dict "recaptchaV3Key" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $waline.reaction -}}
|
||||
{{- $commentConfig = dict "reaction" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://waline.js.org/" rel="external nofollow noopener noreferrer">Waline</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Facebook Comment System */ -}}
|
||||
{{- $facebook := $comment.facebook | default dict -}}
|
||||
{{- if $facebook.enable -}}
|
||||
<div id="fb-root" class="comment"></div>
|
||||
<div
|
||||
class="fb-comments"
|
||||
data-href="{{ .Permalink }}"
|
||||
data-width="{{ $facebook.width }}"
|
||||
data-numposts="{{ $facebook.numPosts }}"
|
||||
></div>
|
||||
{{- $source := printf "https://connect.facebook.net/%v/sdk.js#xfbml=1&version=v5.0&appId=%v&autoLogAppEvents=1" ($facebook.languageCode | default (T "comment.facebookLanguageCode")) $facebook.appId -}}
|
||||
{{- dict "Source" $source "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://developers.facebook.com/docs/plugins/comments/" rel="external nofollow noopener noreferrer">Facebook</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Telegram Comments System */ -}}
|
||||
{{- $telegram := $comment.telegram | default dict -}}
|
||||
{{- if $telegram.enable -}}
|
||||
<div id="telegram-comments" class="comment"></div>
|
||||
{{- $attr := printf `data-comments-app-website="%v"` $telegram.siteID -}}
|
||||
{{- $attr = printf `%v data-limit="%v"` $attr ($telegram.limit | default 5) -}}
|
||||
{{- with $telegram.height -}}
|
||||
{{- $attr = printf `%v data-height="%v"` $attr . -}}
|
||||
{{- end -}}
|
||||
{{- with $telegram.color -}}
|
||||
{{- $attr = printf `%v data-color="%v"` $attr . -}}
|
||||
{{- end -}}
|
||||
{{- if $telegram.colorful -}}
|
||||
{{- $attr = printf `%v data-colorful="1"` $attr -}}
|
||||
{{- end -}}
|
||||
{{- if $telegram.dislikes -}}
|
||||
{{- $attr = printf `%v data-dislikes="1"` $attr -}}
|
||||
{{- end -}}
|
||||
{{- if $telegram.outlined -}}
|
||||
{{- $attr = printf `%v data-outlined="1"` $attr -}}
|
||||
{{- end -}}
|
||||
{{- dict "Source" "https://comments.app/js/widget.js?2" "Defer" true "Attr" $attr | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://comments.app/" rel="external nofollow noopener noreferrer">Telegram Comments</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Commento Comment System */ -}}
|
||||
{{- $commento := $comment.commento | default dict -}}
|
||||
{{- if $commento.enable -}}
|
||||
<div id="commento" class="comment"></div>
|
||||
{{- dict "Source" "https://cdn.commento.io/js/commento.js" "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://commento.io/" rel="external nofollow noopener noreferrer">Commento</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Utterances Comment System */ -}}
|
||||
{{- $utterances := $comment.utterances | default dict -}}
|
||||
{{- if $utterances.enable -}}
|
||||
<div id="utterances" class="comment"></div>
|
||||
{{- $commentConfig = dict "repo" $utterances.repo | dict "utterances" | merge $commentConfig -}}
|
||||
{{- $commentConfig = $utterances.issueTerm | default "pathname" | dict "issueTerm" | dict "utterances" | merge $commentConfig -}}
|
||||
{{- $commentConfig = dict "label" $utterances.label | dict "utterances" | merge $commentConfig -}}
|
||||
{{- $commentConfig = $utterances.lightTheme | default "github-light" | dict "lightTheme" | dict "utterances" | merge $commentConfig -}}
|
||||
{{- $commentConfig = $utterances.darkTheme | default "github-dark" | dict "darkTheme" | dict "utterances" | merge $commentConfig -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://utteranc.es/" rel="external nofollow noopener noreferrer">Utterances</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Twikoo Comment System */ -}}
|
||||
{{- $twikoo := $comment.twikoo | default dict -}}
|
||||
{{- if $twikoo.enable -}}
|
||||
<div id="twikoo"></div>
|
||||
{{- $source := $cdn.twikooJS | default "lib/twikoo/twikoo.all.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $commentConfig = dict "el" "#twikoo" "envId" $twikoo.envId "lang" .Lang | dict "twikoo" | merge $commentConfig -}}
|
||||
{{- with $twikoo.region -}}
|
||||
{{- $commentConfig = dict "region" . | dict "twikoo" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $twikoo.path -}}
|
||||
{{- $commentConfig = dict "path" . | dict "twikoo" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $twikoo.commentCount -}}
|
||||
{{- $commentConfig = dict "commentCount" . | dict "twikoo" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $twikoo.lightgallery -}}
|
||||
{{- $commentConfig = dict "lightgallery" . | dict "twikoo" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://twikoo.js.org/" rel="external nofollow noopener noreferrer">Twikoo</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Giscus Comment System */ -}}
|
||||
{{- $giscus := $comment.giscus | default dict -}}
|
||||
{{- if $giscus.enable -}}
|
||||
{{- with $giscus -}}
|
||||
{{- $commentConfig = .lightTheme | default "light" | dict "lightTheme" | dict "giscus" | merge $commentConfig -}}
|
||||
{{- $commentConfig = .darkTheme | default "dark" | dict "darkTheme" | dict "giscus" | merge $commentConfig -}}
|
||||
<div id="giscus">
|
||||
<script
|
||||
src="https://giscus.app/client.js"
|
||||
data-repo="{{ .Repo }}"
|
||||
data-repo-id="{{ .RepoId }}"
|
||||
data-category="{{ .Category }}"
|
||||
data-category-id="{{ .CategoryId }}"
|
||||
data-mapping="{{ .Mapping }}"
|
||||
data-strict="{{ .Strict }}"
|
||||
{{ if .Term }}data-term="{{ .Term }}"{{ end }}
|
||||
data-theme="preferred_color_scheme"
|
||||
data-reactions-enabled="{{ .ReactionsEnabled }}"
|
||||
data-emit-metadata="{{ .EmitMetadata }}"
|
||||
data-input-position="{{ .InputPosition }}"
|
||||
data-lang="{{ $.Site.LanguageCode }}"
|
||||
{{ if ne .LazyLoad false }}data-loading="lazy"{{ end }}
|
||||
crossorigin="anonymous"
|
||||
async
|
||||
defer
|
||||
></script>
|
||||
</div>
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://giscus.app/" rel="external nofollow noopener noreferrer">giscus</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- /* lightgallery for Artalk and Twikoo */ -}}
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
{{- if not $params.lightgallery | and (($artalk.enable | and $artalk.lightgallery) | or ($twikoo.enable | and $twikoo.lightgallery)) -}}
|
||||
{{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/css/lightgallery-bundle.min.css" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $source := $cdn.lightgalleryJS | default "lib/lightgallery/lightgallery.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $source := $cdn.lightgalleryThumbnailJS | default "lib/lightgallery/plugins/thumbnail/lg-thumbnail.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/plugins/zoom/lg-zoom.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- /* KaTeX for Twikoo */ -}}
|
||||
{{- $math := .Scratch.Get "math" -}}
|
||||
{{- if not $math.enable | and $twikoo.enable | and $twikoo.katex -}}
|
||||
{{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $source := $cdn.katexJS | default "lib/katex/katex.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $source := $cdn.katexAutoRenderJS | default "lib/katex/auto-render.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- dict "comment" $commentConfig | dict "config" | merge (.Scratch.Get "this") | .Scratch.Set "this" -}}
|
@ -0,0 +1,30 @@
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
{{- $expirationReminder := $params.expirationReminder | default dict -}}
|
||||
|
||||
{{- if $expirationReminder.enable -}}
|
||||
{{- $daysAgo := div (sub now.Unix .Lastmod.Unix) 86400 }}
|
||||
{{- $reminderThreshold := $expirationReminder.reminder | default 90 }}
|
||||
{{- $warningThreshold := $expirationReminder.warning | default 180 }}
|
||||
{{- $updateTime := .Lastmod }}
|
||||
|
||||
{{- if gt $daysAgo $reminderThreshold -}}
|
||||
{{- $type := "note" -}}
|
||||
{{- $icon := "fa-pencil-alt" -}}
|
||||
{{- if gt $daysAgo $warningThreshold -}}
|
||||
{{- $type = "warning" -}}
|
||||
{{- $icon = "fa-exclamation-triangle" -}}
|
||||
{{- end -}}
|
||||
<div class="details admonition {{ $type }} open">
|
||||
<div class="details-summary admonition-title">
|
||||
<i class="icon fa-solid {{ $icon }} fa-fw" aria-hidden="true"></i>{{ T (printf "admonition.%v" $type) }}<i class="details-icon fa-solid fa-angle-right fa-fw" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details-content">
|
||||
<div class="admonition-content">
|
||||
{{- with .Site.Params.dateformat | default "2006-01-02" | $updateTime.Format -}}
|
||||
{{- dict "Date" . | T "single.expirationReminder" -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
12
themes/FixIt/layouts/partials/single/fixit-decryptor.html
Normal file
12
themes/FixIt/layouts/partials/single/fixit-decryptor.html
Normal file
@ -0,0 +1,12 @@
|
||||
{{- $msg := (.Scratch.Get "params").message | default (T "single.encryptedMessage") -}}
|
||||
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
|
||||
|
||||
<div class="fixit-decryptor-container">
|
||||
<img class="fixit-decryptor-loading" src="{{ $loading.RelPermalink }}" alt="decryptor loading" />
|
||||
<label for="fixit-decryptor-input" title='{{ T "single.password" }}'>
|
||||
<input type="password" id="fixit-decryptor-input" class="d-none" placeholder="🔑 {{ $msg }}" />
|
||||
</label>
|
||||
<button class="fixit-encryptor-btn d-none">
|
||||
{{- dict "Class" "fa-solid fa-lock" | partial "plugin/icon.html" }} {{ T "single.encryptyAgain" -}}
|
||||
</button>
|
||||
</div>
|
90
themes/FixIt/layouts/partials/single/footer.html
Normal file
90
themes/FixIt/layouts/partials/single/footer.html
Normal file
@ -0,0 +1,90 @@
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
{{- $gitRepo := (strings.TrimSuffix "/" .Site.Params.gitRepo) -}}
|
||||
|
||||
<div class="post-footer" id="post-footer">
|
||||
<div class="post-info">
|
||||
<div class="post-info-line">
|
||||
<div class="post-info-mod">
|
||||
<span title="{{ dict "Date" ("2006-01-02 15:04:05" | .Lastmod.Format) | T "single.updatedOnDate" }}">
|
||||
{{- with .Site.Params.dateformat | default "2006-01-02" | .Lastmod.Format -}}
|
||||
{{- dict "Date" . | T "single.updatedOnDate" -}}
|
||||
{{- if $gitRepo -}}
|
||||
{{- with $.GitInfo -}}
|
||||
<a class="git-hash" href="{{ printf `%v/commit/%v` $gitRepo .Hash }}" rel="external nofollow noopener noreferrer" target="_blank" title="commit by {{ .AuthorName }}({{ .AuthorEmail }}) {{ .Hash }}: {{ .Subject }}">
|
||||
{{- dict "Class" "fa-solid fa-hashtag fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- .AbbreviatedHash -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
</div>
|
||||
{{- with $params.license | string -}}
|
||||
<div class="post-info-license{{ with $params.password }} d-none{{ end }}">
|
||||
<span>{{- . | safeHTML -}} </span>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="post-info-line{{ with $params.password }} d-none{{ end }}">
|
||||
<div class="post-info-md">
|
||||
{{- if $params.linktomarkdown -}}
|
||||
{{- with .OutputFormats.Get "markdown" -}}
|
||||
<span>
|
||||
{{- $options := dict "Class" "link-to-markdown" "Destination" .RelPermalink "Title" (T "single.readMarkdown") "Content" (T "single.readMarkdown") "externalIcon" false -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with $params.edit -}}
|
||||
{{- if .Enable -}}
|
||||
<span>
|
||||
{{- $editUrl := printf "%v/%v" (strings.TrimSuffix "/" .Url) $.File.Path -}}
|
||||
{{- if not (hasPrefix $editUrl "http") -}}
|
||||
{{- $editUrl = printf "%v/%v" $gitRepo (strings.TrimPrefix "/" $editUrl) -}}
|
||||
{{- end -}}
|
||||
{{- $options := dict "Class" "link-to-edit" "Destination" $editUrl "Title" (T "single.editThisPage") "Content" (T "single.editThisPage") "externalIcon" false -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="post-info-share">
|
||||
<span>
|
||||
{{- partial "plugin/share.html" . -}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="post-info-more">
|
||||
<section class="post-tags">
|
||||
{{- with .Params.tags -}}
|
||||
{{- dict "Class" "fa-solid fa-tags fa-fw me-1" | partial "plugin/icon.html" -}}
|
||||
{{- range $value := . -}}
|
||||
{{- $tag := partialCached "function/path.html" $value $value | printf "/tags/%v" | $.Site.GetPage -}}
|
||||
{{- with $tag -}}
|
||||
<a href='{{ partial "function/escapeurl.html" .RelPermalink }}' class="post-tag">{{ .Title }}</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</section>
|
||||
<section>
|
||||
<span><a href="javascript:void(0);" onclick="window.history.back();">{{ T "single.back" }}</a></span> | <span><a href="{{ .Site.Home.RelPermalink }}">{{ T "single.home" }}</a></span>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="post-nav">
|
||||
{{- with .PrevInSection -}}
|
||||
<a href="{{ .RelPermalink }}" class="post-nav-item" rel="prev" title="{{ .Title }}">
|
||||
{{- dict "Class" "fa-solid fa-angle-left fa-fw" | partial "plugin/icon.html" -}}
|
||||
{{- .Title -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{ with .NextInSection }}
|
||||
<a href="{{ .RelPermalink }}" class="post-nav-item" rel="next" title="{{ .Title }}">
|
||||
{{- .Title -}}
|
||||
{{- dict "Class" "fa-solid fa-angle-right fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
56
themes/FixIt/layouts/partials/single/newsletter.html
Normal file
56
themes/FixIt/layouts/partials/single/newsletter.html
Normal file
@ -0,0 +1,56 @@
|
||||
<div class="newsletter">
|
||||
<style type="text/css" scoped>
|
||||
.mauticform_wrapper { max-width: 600px; margin: 10px auto; }
|
||||
.mauticform-innerform {}
|
||||
.mauticform-post-success {}
|
||||
.mauticform-name { font-weight: bold; font-size: 1.5em; margin-bottom: 3px; }
|
||||
.mauticform-description { margin-top: 2px; margin-bottom: 10px; }
|
||||
.mauticform-error { margin-bottom: 10px; color: red; }
|
||||
.mauticform-message { margin-bottom: 10px;color: green; }
|
||||
.mauticform-row { display: block; margin-bottom: 20px; }
|
||||
.mauticform-row.mauticform-required .mauticform-label:after { color: #e32; content: " *"; display: inline; }
|
||||
.mauticform-helpmessage { display: block; font-size: 0.9em; margin-bottom: 3px; }
|
||||
.mauticform-errormsg { display: block; color: red; margin-top: 2px; }
|
||||
.mauticform-selectbox, .mauticform-input, .mauticform-textarea { width: 100%; padding: 0.5em 0.5em; border: 1px solid #CCC; background: #fff; box-shadow: 0px 0px 0px #fff inset; border-radius: 4px; box-sizing: border-box; }
|
||||
.mauticform-checkboxgrp-row {}
|
||||
.mauticform-checkboxgrp-label { font-weight: normal; }
|
||||
.mauticform-checkboxgrp-checkbox {}
|
||||
.mauticform-radiogrp-row {}
|
||||
.mauticform-radiogrp-label { font-weight: normal; }
|
||||
.mauticform-radiogrp-radio {}
|
||||
.mauticform-button-wrapper .mauticform-button.btn-default, .mauticform-pagebreak-wrapper .mauticform-pagebreak.btn-default { color: #5d6c7c;background-color: #ffffff;border-color: #dddddd;}
|
||||
.mauticform-button-wrapper .mauticform-button, .mauticform-pagebreak-wrapper .mauticform-pagebreak { display: inline-block;margin-bottom: 0;font-weight: 600;text-align: center;vertical-align: middle;cursor: pointer;background-image: none;border: 1px solid transparent;white-space: nowrap;padding: 6px 12px;font-size: 13px;line-height: 1.3856;border-radius: 3px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}
|
||||
.mauticform-button-wrapper .mauticform-button.btn-default[disabled], .mauticform-pagebreak-wrapper .mauticform-pagebreak.btn-default[disabled] { background-color: #ffffff; border-color: #dddddd; opacity: 0.75; cursor: not-allowed; }
|
||||
.mauticform-pagebreak-wrapper .mauticform-button-wrapper { display: inline; }
|
||||
</style><style type="text/css" scoped>
|
||||
.mauticform-field-hidden { display:none }
|
||||
</style>
|
||||
|
||||
<div id="mauticform_wrapper_doubleoptin" class="mauticform_wrapper">
|
||||
<h3>{{- T "newsletterSignup" -}}</h3>
|
||||
<form autocomplete="false" role="form" method="post" action="https://ma.m3tam3re.com/form/submit?formId=2" id="mauticform_doubleoptin" data-mautic-form="doubleoptin" enctype="multipart/form-data">
|
||||
<div class="mauticform-error" id="mauticform_doubleoptin_error"></div>
|
||||
<div class="mauticform-message" id="mauticform_doubleoptin_message"></div>
|
||||
<div class="mauticform-innerform">
|
||||
|
||||
<div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">
|
||||
|
||||
<div id="mauticform_doubleoptin_first_nae" data-validate="first_nae" data-validation-type="text" class="mauticform-row mauticform-text mauticform-field-1 mauticform-required">
|
||||
<input id="mauticform_input_doubleoptin_first_nae" name="mauticform[first_nae]" required placeholder="First Name" value="" class="field" type="text">
|
||||
|
||||
<input id="mauticform_input_doubleoptin_email" name="mauticform[email]" required placeholder="E-Mail" value="" class="field" type="email">
|
||||
</div>
|
||||
|
||||
<div id="mauticform_doubleoptin_submit">
|
||||
<button type="submit" name="mauticform[submit]" id="mauticform_input_doubleoptin_submit" value="" class="button">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="mauticform[formId]" id="mauticform_doubleoptin_id" value="2">
|
||||
<input type="hidden" name="mauticform[return]" id="mauticform_doubleoptin_return" value="">
|
||||
<input type="hidden" name="mauticform[formName]" id="mauticform_doubleoptin_name" value="doubleoptin">
|
||||
|
||||
</form>
|
||||
<p>{{- T "supportMe" -}}<a href="monero:42xGGy9sAXB4cJX4vrHXAh3Pq13Z8AESs1sVrpqi9mrj9euRYDEhgnjLzTk8ZFrntWFRDmAkuafEjisgyKxTVWMWRa3Bg2x" title="Monero Wallet">{{- dict "Simpleicons" "monero" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}</a> <a href="/img/wallet.png" title="Monero QR Code" target="_blank">{{- dict "Simpleicons" "monero" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}</a> <a href="https://liberapay.com/m3tam3re/" title="Liberapay">{{- dict "Simpleicons" "liberapay" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}</a> <a href="https://ko-fi.com/m3tam3re" title="Ko-Fi">{{- dict "Simpleicons" "kofi" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}</a></p>
|
||||
</div>
|
23
themes/FixIt/layouts/partials/single/post-author.html
Normal file
23
themes/FixIt/layouts/partials/single/post-author.html
Normal file
@ -0,0 +1,23 @@
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
{{- $author := .Scratch.Get "author" -}}
|
||||
|
||||
<span class="post-author">
|
||||
{{- $content := $author.name -}}
|
||||
{{- $icon := dict "Class" "fa-solid fa-user-circle" -}}
|
||||
{{- if $author.avatar | and $params.authorAvatar -}}
|
||||
{{- $content = printf "%v %v" (dict "Src" $author.avatar "Class" "avatar" "Alt" $author.name | partial "plugin/image.html") $author.name -}}
|
||||
{{- $icon = "" -}}
|
||||
{{- end -}}
|
||||
{{- if $author.link -}}
|
||||
{{- $options := dict "Class" "author" "Destination" $author.link "Title" (T "single.author") "Rel" "author" "Icon" $icon "Content" $content -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- else -}}
|
||||
<span class="author">
|
||||
{{- with $icon -}}
|
||||
{{- . | partial "plugin/icon.html" }}
|
||||
{{ end -}}
|
||||
{{- $content | safeHTML -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- /* EOF */ -}}
|
4
themes/FixIt/layouts/partials/single/reward.html
Normal file
4
themes/FixIt/layouts/partials/single/reward.html
Normal file
@ -0,0 +1,4 @@
|
||||
{{- $reward := .Scratch.Get "reward" -}}
|
||||
{{- $author := .Scratch.Get "author" -}}
|
||||
{{- $options := dict "Reward" $reward "Id" "fi-reward" "Author" $author.name -}}
|
||||
{{- partial "plugin/reward.html" $options -}}
|
Reference in New Issue
Block a user