Home Blog Talks

Easily add disqus to your astro site

2024-08-24

Disqus is a popular comment system that can be easily added to your website.

I create a astro component to help you easily add Disqus to your Astro site, and it supports astro’s view transitions.

This article will show you how to add Disqus to your Astro site.

Usage

  1. Create a Disqus account and register your site.
  2. Install the Disqus component: npm install astro-disqus.
  3. Add the Disqus component to your Astro site:
---
import Disqus from 'astro-disqus';
---

<!-- Notice: replace demo with your disqus site slug -->
<Disqus embed="https://demo.disqus.com/embed.js" />

Advanced Usage

You can customize the Disqus component by passing props:

<Disqus
  embed="https://demo.disqus.com/embed.js"
  url="https://example.com"
  class="class-name"
  style="color: red"
/>

References

Back to all posts