Prepare for Docker Deploy

This commit is contained in:
FlintyLemming
2026-01-19 11:22:22 +08:00
parent 9003d8863e
commit de825f91ac
61 changed files with 557 additions and 127 deletions

View File

@@ -1,21 +1,27 @@
{{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}}
<div id="cusdis_thread"
data-host="{{ $host }}"
data-app-id="{{ .Site.Params.comments.cusdis.id }}"
data-page-id="{{ .File.UniqueID }}"
data-page-url="{{ .Permalink }}"
data-page-title="{{ .Title }}"></div>
<div id="cusdis_thread" data-host="{{ $host }}" data-app-id="{{ .Site.Params.comments.cusdis.id }}"
data-page-id="{{ .File.UniqueID }}" data-page-url="{{ .Permalink }}" data-page-title="{{ .Title }}"></div>
<script async defer src="{{ $host }}/js/cusdis.es.js"></script>
<script>
function setCusdisTheme(theme) {
let cusdis = document.querySelector('#cusdis_thread iframe');
if (cusdis) {
window.CUSDIS.setTheme(theme)
window.CUSDIS.setTheme(theme);
cusdis.contentWindow.document.body.style.backgroundColor = window.getComputedStyle(document.body).backgroundColor;
}
}
window.addEventListener('load', function () {
let iframe = document.querySelector("#cusdis_thread iframe");
if (iframe) {
let observer = new MutationObserver(() => {
let scrollHeight = iframe.contentWindow.document.body.scrollHeight;
iframe.style.height = scrollHeight + "px";
});
observer.observe(iframe.contentWindow.document.body, { childList: true, subtree: true });
}
});
window.addEventListener('onColorSchemeChange', (e) => {
setCusdisTheme(e.detail)
})
</script>
</script>

View File

@@ -1,5 +1,5 @@
<div class="disqus-container">
{{ template "_internal/disqus.html" . }}
{{ partial "disqus.html" . }}
</div>
<style>

View File

@@ -2,7 +2,7 @@
{{- $disqusjs := .Site.Params.Comments.disqusjs -}}
{{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}}
{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | resources.ToCSS | minify -}}
{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | toCSS | minify -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<div class="disqus-container">
@@ -21,8 +21,12 @@
}
function lazyLoadDisqusJS() {
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
const excludedHosts = ["localhost", "127.0.0.1"];
const hostname = window.location.hostname;
if (excludedHosts.includes(hostname)) {
document.getElementById('disqus_thread').innerHTML =
'Disqus comments not available by default when the website is previewed locally.';
return;
}

View File

@@ -12,6 +12,7 @@
data-input-position="{{- default `top` .inputPosition -}}"
data-theme="{{- default `light` .lightTheme -}}"
data-lang="{{- default `en` .lang -}}"
data-loading="{{- .loading -}}"
crossorigin="anonymous"
async
></script>

View File

@@ -15,11 +15,13 @@
admin: ["{{- .admin -}}"],
distractionFreeMode: false, // Facebook-like distraction free mode
id: md5(location.pathname), // Max Location.pathname Legth:75 https://github.com/gitalk/gitalk/issues/102
proxy: {{- .proxy -}},
});
(function () {
if (
["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1
) {
const excludedHosts = ["localhost", "127.0.0.1"];
const hostname = window.location.hostname;
if (excludedHosts.includes(hostname)) {
document.getElementById("gitalk-container").innerHTML =
"Gitalk comments not available by default when the website is previewed locally.";
return;

View File

@@ -1,4 +1,4 @@
<script src="//cdn.jsdelivr.net/npm/twikoo@1.6.21/dist/twikoo.all.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/twikoo@1.6.44/dist/twikoo.all.min.js"></script>
<div id="tcomment"></div>
<style>
.twikoo {
@@ -24,8 +24,11 @@
.twikoo .tk-preview-container,
.twikoo .tk-content,
.twikoo .tk-nick,
.twikoo .tk-send {
color: var(--twikoo-body-text-color-main);
.twikoo .tk-send,
.twikoo .tk-comments-no,
.twikoo .el-input__count,
.twikoo .tk-submit-action-icon {
color: var(--twikoo-body-text-color-main)!important;
}
.twikoo .el-button{
color: var(--twikoo-body-text-color)!important;

View File

@@ -16,7 +16,7 @@
{{- with .Site.Params.comments.waline -}}
{{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}}
{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" -}}
{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" "turnstilekey" "turnstileKey" -}}
{{- range $key, $val := . -}}
{{- if ne $val nil -}}