From d86f70a1791b47c6ffa76355e4e1d88d20e61d3f Mon Sep 17 00:00:00 2001
From: shaked8634 <3531852+shaked8634@users.noreply.github.com>
Date: Thu, 25 Apr 2024 17:20:31 +0000
Subject: [PATCH] Added support + doc to Cusdis (#907)
---
layouts/posts/single.html | 1 +
docs/configurations.md | 9 +++++++++
layouts/partials/posts/cusdis.html | 16 ++++++++++++++++
CONTRIBUTORS.md | 3 ++-
4 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 8948637..293b6b8 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -139,5 +139,6 @@
- [Jens Rantil](https://github.com/JensRantil)
- [Muqeet Malik](https://github.com/mmalik23)
- [Sammy44nts](https://github.com/sammy44nts)
+- [Shaked8634](https://github.com/shaked8634)
- [Leo Heimann Ruiz](https://leo.heitmannruiz.org/)
-- [Antoine "Toinux" Wam](https://github.com/itzwam)
+- [Antoine "Toinux" Wam](https://github.com/itzwam)
\ No newline at end of file
diff --git a/docs/configurations.md b/docs/configurations.md
index 79479fd..2cd5691 100644
--- a/docs/configurations.md
+++ b/docs/configurations.md
@@ -7,6 +7,7 @@
* [Commento](#commento)
* [Utterances](#utterances)
* [Giscus](#giscus)
+ * [Cusdis](#cusdis)
* [Syntax Highlight](#syntax-highlight)
* [Theme Parameters](#theme-parameters)
* [Social Icons Configuration](#social-icons-configuration)
@@ -27,6 +28,7 @@
* [Commento](https://commento.io/)
* [Utterances](https://utteranc.es/)
* [Giscus](https://giscus.app/)
+ * [Cusdis](https://cusdis.com/)
* [Telegram](https://comments.app/)
### Commenting Systems
@@ -87,6 +89,13 @@
dark = ""
```
+#### Cusdis
+
+```toml
+[params.cusdis] # https://cusdis.com
+ data_app_id = ""
+```
+
## Syntax Highlight
The theme uses the Goldmark syntax highlight system. GitHub light and dark are set as the default styles. To choose a different style, make sure `noClasses` is not set to false (default is true) and add to your `config.toml`:
diff --git a/layouts/partials/posts/cusdis.html b/layouts/partials/posts/cusdis.html
new file mode 100644
index 0000000..c68fe2a
--- /dev/null
+++ b/layouts/partials/posts/cusdis.html
@@ -0,0 +1,16 @@
+{{- if isset .Site.Params "cusdis" -}}
+ {{- if and (isset .Site.Params.cusdis "data_app_id") (eq (.Params.disableComments | default false) false) -}}
+ <div class="comments">
+ <h4>Comments:</h4>
+ <div id="cusdis_thread"
+ data-host="https://cusdis.com"
+ data-app-id="{{ .Site.Params.cusdis.data_app_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>
+ </div>
+ {{- end -}}
+{{- end -}}
+
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index 4e3a140..03a6dc3 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -47,6 +47,7 @@
{{ partial "posts/giscus.html" . }}
{{ partial "posts/mastodon.html" . }}
{{ partial "posts/telegram.html" . }}
+ {{ partial "posts/cusdis.html" . }}
</footer>
</article>
--
Gitblit v1.10.0