Skip to content

Adding a comment system

Material for MkDocs is natively integrated with Disqus, a comment system that provides a wide range of features like social integrations, user profiles, as well as spam and moderation tools. Of course, other comment systems can be integrated, too.

Configuration

Disqus

1.1.0 ยท Default: none

First, ensure you've set site_url in mkdocs.yml. Then, to integrate Material for MkDocs with Disqus, create an account and a site giving you a shortname, and add it to mkdocs.yml:

extra:
  disqus: <shortname>

This will insert a comment system on every page, except the index page.

Customization

Selective integration

When Metadata is enabled, Disqus can be enabled or disabled for a document with custom front matter. Add the following lines at the top of a Markdown file:

---
disqus: <shortname>
---

# Document title
...
---
disqus: ""
---

# Document title
...

Other comment systems

In order to integrate another JavaScript-based comment system provider, you can extend the theme, create a new main.html in overrides and override the disqus block:

{% extends "base.html" %}

{% block disqus %}
  <!-- Add custom comment system integration here -->
{% endblock %}
Back to top