Switch to using data-* attributes

main
Jez Cope 2 years ago
parent 246ba8bf87
commit f49915e134

@ -1,7 +0,0 @@
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: "{{ .File.BaseFileName }}" // unique ID for this comments section.
})

@ -1,13 +1,17 @@
<script type="text/javascript" src="/js/navbar.js"></script>
{{ $page_id := .File.BaseFileName }}
{{ if .Site.Params.comments.webmention }}
{{ $webmention_js := resources.Get "js/webmention.js" | minify }}
<script src="{{ $webmention_js.RelPermalink }}"
data-page-url="{{ .Permalink }}"
async></script>
{{ end }}
{{ if .Site.Params.comments.cactus }}
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"></script>
{{ $cactus_js := resources.Get "js/cactus.js.tmpl" | resources.ExecuteAsTemplate "js/cactus.js" . }}
<script src="{{ $cactus_js.RelPermalink }}" async></script>
{{ with .Site.Params.comments.cactus }}
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"
data-default-homeserver-url="https://matrix.cactus.chat:8448"
data-server-name="cactus.chat"
data-site-name="{{ . }}"
data-node="#cactus-comments"
data-comment-section-id="{{ $page_id }}"></script>
{{ end }}

Loading…
Cancel
Save