Files
hugo/content/content-management/comments.md
T
2017-02-27 16:59:03 -06:00

3.1 KiB
Raw Blame History

title, linktitle, description, date, publishdate, lastmod, tags, categories, weight, draft, aliases, toc, wip
title linktitle description date publishdate lastmod tags categories weight draft aliases toc wip
Comments Comments Hugo ships with an internal Disqus template that requires negligible effort to implement, but Disqus isn't the only commenting system that will work with your new Hugo website. 2017-02-01 2017-02-01 2017-02-01
sections
content
organization
fundamentals
project organization
140 false
/extras/comments/
true true

As Hugo is a static site generator, the content produced is static and doesn't allow for a high degree of interaction with the website's end users. The most common interaction people ask for in static websites is the ability to add comments.

Hugo ships with support for Disqus, a third-party service that provides comment and community capabilities to websites via JavaScript.

Your theme may already support Disqus, but even it if doesnt, it is easy to add.

Disqus

Hugo comes with all the code you need to include load [Disqus][], a popular commenting service for both static and dynamic websites.

Configuring Disqus

Disqus comments require you set a single value in your site's configuration file. The following show the configuration variable in TOML and YAML, respectively:

disqusShortname = "yourdiscussshortname"
disqusShortname: "yourdiscussshortname"

For many website, this is enough configuration. However, you also have the option to set the following in the front matter of a single content file:

  • disqus_identifier
  • disqus_title
  • disqus_url

Rendering Hugo's Built-in Disqus Partial Template

See Partial Templates to learn how to add the Disqus partial to your Hugo website's templates.

Commenting Alternatives

There are a few alternatives to commenting on static sites for those who do not want to use Hugo's built-in Disqus support:

Kaiju

Kaiju is an open-source project started by spf13 (Hugos author) to bring easy and fast real time discussions to the web.

Written using Go, Socket.io, and MongoDB, Kaiju is very fast and easy to deploy.

It is in early development but shows promise. If you have interest, please help by contributing via pull request, opening an issue in the Kaiju GitHub repository, or Tweeting about it. Every bit helps.