Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHue <19755727+HueLiu@users.noreply.github.com>2021-10-31 12:15:57 +0300
committerGitHub <noreply@github.com>2021-10-31 12:15:57 +0300
commit25581cc44637909a75aacdf33f896192f0569689 (patch)
tree5087dc18192257998968c5f47eb1c6e7a97352a1 /layouts
parenta7d316365cd95247d16fa0b82f22ac121b3f7184 (diff)
fix(comments/cusdis): use the correct script for the self-hosted version (#403)
* Modify the Self-hosting js source path * refactor(comments/cusdis): avoid multiple if statement Co-authored-by: Jimmy Cai <github@jimmycai.com>
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/comments/provider/cusdis.html11
1 files changed, 4 insertions, 7 deletions
diff --git a/layouts/partials/comments/provider/cusdis.html b/layouts/partials/comments/provider/cusdis.html
index 71863f3..a89746c 100644
--- a/layouts/partials/comments/provider/cusdis.html
+++ b/layouts/partials/comments/provider/cusdis.html
@@ -1,14 +1,11 @@
+{{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}}
<div id="cusdis_thread"
- {{ if .Site.Params.comments.cusdis.host }}
- data-host="{{ .Site.Params.comments.cusdis.host }}"
- {{ else }}
- data-host="https://cusdis.com"
- {{ end }}
+ 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="https://cusdis.com/js/cusdis.es.js"></script>
+<script async defer src="{{ $host }}/js/cusdis.es.js"></script>
<script>
function setCusdisTheme(theme) {
@@ -21,4 +18,4 @@
window.addEventListener('onColorSchemeChange', (e) => {
setCusdisTheme(e.detail)
})
-</script> \ No newline at end of file
+</script>