add cactus comments

This commit is contained in:
pluja 2024-03-25 11:07:59 +01:00
parent 41448ea966
commit 1aa3bccc20
4 changed files with 41 additions and 26 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -573,33 +573,23 @@
</div>
<div class="m-2 rounded-xl bg-gray-500/10">
<h2 id="comments">(nostr) comments</h2>
<h2 id="comments">(matrix) comments</h2>
<p>
Each service has a dedicated comments article. The comments are suppored
by <a href="https://usenostr.org">Nostr</a>, a decentralized structured
data sharing protocol used to build social networks.
Each service has a dedicated comments section. The comments are suppored
by <a rel="no-referrer" target="_blank" href="https://matrix.org">Matrix</a>, an open network for secure,
decentralised communication, thanks to <a rel="no-referrer" target="_blank" href="https://cactus.chat/">Cactus</a>.
</p>
<p>
<a href="/nostr"
>Click here for a quick guide on how to use Nostr comments.</a
>
To comment on a service's page, you just need a <a rel="no-referrer" target="_blank" href="https://matrix.org/try-matrix/">Matrix account</a>. This method gives users full control over who hosts their data. Users can log in using any Matrix server they choose.
</p>
<p>
To comment on a service's page, you just need a Nostr private key and a
secure
<a
rel="noreferrer"
href="https://github.com/aljazceru/awesome-nostr#nip-07-browser-extensions"
target="_blank"
>nostr siging extension (nip-07)</a
>
for logging in. I recommend using
<a href="https://getalby.com/" target="_blank">Alby</a> or
<a href="https://github.com/fiatjaf/nos2x" target="_blank">nos2x</a>
You can read and post comments in your browser, or continue the conversation using any other Matrix client. Comment sections are accesible from any homeserver on the Matrix network.
</p>
<p>The <a rel="no-referrer" target="_blank" href="https://gitlab.com/cactus-comments">source code</a> for the web client is LGPLv3 licensed, and the backend service is AGPLv3 licensed.</p>
</div>
<div class="m-2 rounded-xl bg-gray-500/10">

View File

@ -1,3 +1,8 @@
<head>
<script type="text/javascript" src="/static/js/cactus.js"></script>
<link rel="stylesheet" href="/static/css/cactus.css" type="text/css">
</head>
<section class="p-2 mt-8 mb-2">
<!-- Pending Approval Notice -->
{{if .Service.Pending}}
@ -225,28 +230,40 @@
<div class="my-2 w-full border-t-2 border-opacity-50 border-dashed border-t-lime-400/10"></div>
<!-- Comments -->
<section class="flex flex-col justify-center items-center p-4 mb-16" id="discuss">
<a href="/about#nostr-comments" target="_blank" class="text-xl font-bold">
<a href="/about#matrix-comments" target="_blank" class="text-xl font-bold">
<svg xmlns="http://www.w3.org/2000/svg" class="inline-block w-4 h-4 messages" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M21 14l-3 -3h-7a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1h9a1 1 0 0 1 1 1v10"></path>
<path d="M14 15v2a1 1 0 0 1 -1 1h-7l-3 3v-10a1 1 0 0 1 1 -1h2"></path>
</svg>
<span>Nostr Comments</span>
<span>Matrix Comments</span>
<span class="text-xs text-white/30">?</span>
</a>
<h2 class="text-xl font-bold"></h2>
<p class="pb-4 mt-1 max-w-sm text-xs text-center text-gray-500 text-opacity-75">Beware of fake reviews and accounts. Verify user profiles and conduct your own research.</p>
<!-- div with the ID disgus where you would like to display the comments & form -->
<div id="disgus" class="w-full max-w-xl">
<div id="comment-section" class="w-full max-w-xl">
<noscript>
<p class="font-bold text-center text-yellow-300">
You must have JavaScript enabled to see and use comments. It just will load a 200kb script to interact with Nostr. The source code is available
<a target="_blank" class="underline" href="https://github.com/carlitoplatanito/disgus">here</a>.
<p class="mb-2 font-bold text-center text-yellow-300">
You can enable JavaScript to see and use comments here. It just will load a 150kb open-source script to interact with Matrix.
The source code is available <a target="_blank" class="underline" href="https://gitlab.com/cactus-comments/cactus-client/-/tree/main/src?ref_type=heads">here</a>.
</p>
<p class="font-bold text-center text-yellow-500/50">> If you still want to avoid using Javascript in the browser, you can use a Matrix Client to read comments: <a class="underline" href="https://matrix.to/#/%23comments_testing-knm-local_{{.Service.Name}}%3Acactus.chat">matrix.to</a></p>
</noscript>
</div>
</section>
<!-- this can go at the end of the body -->
<script type="module" src="/static/disgus/index.js" async></script>
<script>
initComments({
node: document.getElementById("comment-section"),
defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
serverName: "cactus.chat",
siteName: "testing-knm-local",
commentSectionId: "{{.Service.Name}}",
guestPostingEnabled: false
})
</script>