Disqus and Next.js

Disqus and Next.js

In this post, you will learn how to add comments to your Next.js project. And it is easy with Disqus.

First, create an account on Disqus.

Second, go to the https://disqus.com/profile/signup/intent/ and press "I want to install Disqus on my site", fill-up the form, and remember the short name (it will be useful later).

Third, install the disqus-react package from npm. If you are a Typescript user, this package already has typings.

npm install disqus-react

And use it like this:

import { DiscussionEmbed } from "disqus-react"

<DiscussionEmbed
  shortname={"remember that short name from second step?"}
  config={{
    url: "this page url",
    identifier: "unique identifier of this page",
    title: "this page title"
  }}
/>

You can find a usage example here: comments.tsx

Image gallery with Cloudinary

Image gallery with Cloudinary

Here's how I build an image gallery with Cloudinary

How to serve sitemap.xml with Next.JS

How to serve sitemap.xml with Next.JS

Quick guide with code and explanation on sitemap.xml with Next.JS

First major refactoring

First major refactoring

the birthday of the Bar part of barhamon.com