monkeyWzr / hugo-theme-cactus

Cactus theme for hugo
MIT License
537 stars 338 forks source link

Added utteranc.es and Cactus Comments support #104

Closed oneleaftea closed 3 years ago

oneleaftea commented 3 years ago

Hello,

I removed my previous pull request for adding utteranc.es since there was already a pull request for that. Instead, I wanted to submit this one that includes both utteranc.es and Cactus Comments (not to be confused with the Cactus theme here) as separate partials... Cactus Comments is the one that uses the matrix protocol.

I moved disqus to a separate partial, and added cactus_comments and utterances as separate partials. I tested the three different comment engines and they all work well (using Hugo version 0.86.1).

I also included the config.toml in the exampleSite for the new parameters. Also, head.html needed a couple lines for css and javascript sources that are used for Cactus Comments.

netlify[bot] commented 3 years ago

❌ Deploy Preview for condescending-goldberg-725911 failed.

🔨 Explore the source changes: 02e057b3bc6a7870955d908d8c7789ba6ee9bc88

🔍 Inspect the deploy log: https://app.netlify.com/sites/condescending-goldberg-725911/deploys/61228719f1b83a0008908e82

oneleaftea commented 3 years ago

Here is a screenshot of cactus comments:

cactus_comments_screenshot

oneleaftea commented 3 years ago

And a screenshot of utterances:

utterances_screenshot

monkeyWzr commented 3 years ago

@oneleaftea Nice! Thank you very much! (And please ignore the netlify bot. I haven't done with the setup:D)

monkeyWzr commented 3 years ago

@oneleaftea Hi there Thank you again for the help! I really enjoy the Cactus Comments! Thanks for letting me know that After fixing the netlify setting, the deployment finally works and the changes look nice! But there is only one thing:

Screenshot from 2021-08-31 23-53-26

Any idea what's that means? You can check the preview for details https://612e3ce3da61db21c006316d--condescending-goldberg-725911.netlify.app/posts/code-block-test/

(does not seems to be a big deal so I'll keep the merge)

Best regards!

oneleaftea commented 3 years ago

Oh yea, there is an important param that must be set: (it should be in the config.toml of the exampleSite for reference) [params.comments.cactuscomments] siteName = "your_cactus_comments_sitename"

Once you change the siteName to one that you registered, it should work. I looked at the source of the preview details and it still has the filler sitename "your_cactus_comments_sitename" in there...

Registering a siteName is very easy: To do this, start a new chat (any Matrix client... I used Element) with @cactusbot:cactus.chat and type...

register some_site_name (just pick a site_name)

Once you type it in, within a few seconds, you should get a bot response really quickly. If you don't, it means their bot is not working and you'll have to try again. That happened to me before.

Once it's confirmed, you can put that in the param and it should work! Hope it works out!

oneleaftea commented 3 years ago

Oh, I registered a cactus comments site name called: condescending-goldberg-test It took me a few tries with the cactus bot... so i wanted to try to get it to work for you so you can test it.

If you put that in config.toml, it should work: [params.comments.cactuscomments] siteName = "condescending-goldberg-test"

You can always change it to a different one (it'll show up with me as moderator on this test one).

oneleaftea commented 3 years ago

You can see below... when I tried to register, it didn't work. And then later I typed help and it got the bot to react. And then I typed "register condescending-goldberg-test" and it worked the second time. Then I rebuilt the hugo site with that sitename and it worked.

Screenshot at 2021-08-31 09-23-24

monkeyWzr commented 3 years ago

@oneleaftea Thank you for helping! I'll try it later this week(sorry I'm stuck at something else