DEV Community

Cover image for Add a commenting platform to a Svelte app
Mike
Mike

Posted on β€’ Originally published at mikenikles.com

1

Add a commenting platform to a Svelte app

This post first appeared on www.mikenikles.com. Photo by Art Lasovsky on Unsplash

Happy new year!

I recently relaunched my personal blog at www.mikenikles.com using Svelte (learn why).

Initial feedback was to allow visitors to leave comments and have discussions. I took that feedback and found www.commento.io which looked lightweight enough and straitforward to implement.

What I did:

  1. Sign up at www.commento.io
  2. Create a Svelte component that displays comments

The component is as simple as this (corresponding pull request):

<svelte:head>
  <script src="https://cdn.commento.io/js/commento.js"></script>
</svelte:head>

<h2>Comments, Feedback, Thoughts</h2>
<div id="commento" />
Enter fullscreen mode Exit fullscreen mode

Configuration

You can style the commenting platform by providing a data-css-override attribute to the script tag, for example:

<script src="https://cdn.commento.io/js/commento.js" data-css-override="http://example.com/my-custom-styling.css"></script>
Enter fullscreen mode Exit fullscreen mode

Additional configuration options can be found in the documentation.

Are there other alternatives you have experience with? What do you like / dislike about them?

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

Top comments (2)

Collapse
 
gabymarraro profile image
gabymarraro β€’

Have you had luck with the automatic spam filtering? I am implementing it now, but it looks like I can freely post spammy comments. Not sure if there's additional steps to take to get the automatic spam moderation going? I am using their cloud service.

Collapse
 
mikenikles profile image
Mike β€’

Hi, I haven't had an issue with spam yet and also haven't tried it myself. I don't recall reading much in the docs about what is considered spam by their software. It may be worth reaching out to the creator directly.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free β†’

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay