--- template: overrides/main.html --- # Adding a comment system Material for MkDocs allows to easily add the third-party comment system of your choice to the footer of every page by using [theme extension]. As an example, we'll be integrating [Disqus] a wildly popular comment provider, but others can be integrate with the same principles [Disqus]: https://disqus.com/ ## Customization ### Disqus integration In order to integrate a third-party comment provider offering a JavaScript-based solution, follow the guide on [theme extension], copy the contents from the [`content.html`][content partial] partial and create a file at the same location in the `overrides` folder: === ":octicons-file-code-16: overrides/partials/content.html" ``` html {% set disqus = config.extra.disqus %} {% if page and page.meta and page.meta.disqus is string %} {% set disqus = page.meta.disqus %} {% endif %} {% if not page.is_homepage and disqus %}

{{ lang.t("meta.comments") }}

{% endif %} ``` 1. Ensure you've set [`site_url`][site_url] in `mkdocs.yml`. === ":octicons-file-code-16: mkdocs.yml" ``` yaml extra: disqus: # (1) ``` 1. Add your Disqus [shortname] here. [theme extension]: ../customization.md#extending-the-theme [content partial]: https://github.com/squidfunk/mkdocs-material/blob/master/src/partials/content.html [shortname]: https://help.disqus.com/en/articles/1717111-what-s-a-shortname #### on a single page When [Metadata] is enabled, Disqus can be enabled or disabled for a single page with custom front matter. Add the following lines at the top of a Markdown file: === ":octicons-check-circle-fill-16: Enabled" ``` bash --- disqus: --- # Document title ... ``` === ":octicons-skip-16: Disabled" ``` bash --- disqus: "" --- # Document title ... ``` [Metadata]: extensions/python-markdown.md#metadata