diff --git a/assets/js/cactus.js.tmpl b/assets/js/cactus.js.tmpl new file mode 100644 index 0000000..2f34d98 --- /dev/null +++ b/assets/js/cactus.js.tmpl @@ -0,0 +1,7 @@ +initComments({ + node: document.getElementById("cactus-comments"), // HTML element to make comments section in + defaultHomeserverUrl: "https://matrix.cactus.chat:8448", // full url of the Matrix server to use as guest + serverName: "cactus.chat", // server name of the Matrix server w/ Cactus Appservice + siteName: "{{ .Site.Params.comments.cactus }}", // the name that you registered with the cactus appservice + commentSectionId: "{{ .Page.Permalink }}" // unique ID for this comments section. +}) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 4a2431b..f58a4ec 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,6 +14,7 @@ {{ with .Site.Params.author }}{{ end }} {{ $style := resources.Get "style/main.sass" | resources.ToCSS }} + {{ if .Site.Params.comments.cactus }}{{ end }} {{ with .OutputFormats.Get "RSS" -}} {{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} {{- end }} diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 31ff3f3..f6805df 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -2,6 +2,7 @@
{{ partial "comments/webmention" . }} + {{ partial "comments/cactus" . }} {{ with .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }} diff --git a/layouts/partials/comments/cactus.html b/layouts/partials/comments/cactus.html new file mode 100644 index 0000000..5272c1d --- /dev/null +++ b/layouts/partials/comments/cactus.html @@ -0,0 +1,7 @@ +{{ if .Site.Params.comments.cactus }} +
+
+

Comments

+
+
+{{ end }} diff --git a/layouts/partials/comments/webmention.html b/layouts/partials/comments/webmention.html index 0ca0b4d..331545c 100644 --- a/layouts/partials/comments/webmention.html +++ b/layouts/partials/comments/webmention.html @@ -1,7 +1,7 @@ {{ if .Site.Params.comments.webmention }}
-

Comments

+

Webmentions

diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 62a2cb0..2c808ca 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -6,3 +6,8 @@ data-page-url="{{ .Permalink }}" async> {{ end }} +{{ if .Site.Params.comments.cactus }} + + {{ $cactus_js := resources.Get "js/cactus.js.tmpl" | resources.ExecuteAsTemplate "js/cactus.js" . }} + +{{ end }}