--- 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 any page by using [theme extension]. As an example, we'll be integrating [Giscus], which is Open Source, free, and uses GitHub discussions as a backend. [Giscus]: https://giscus.app/ ## Customization ### Giscus integration Before you can use [Giscus], you need to complete the following steps: 1. __Install the [Giscus GitHub App]__ and grant access to the repository that should host comments as GitHub discussions. Note that this can be a repository different from your documentation. 2. __Visit [Giscus] and generate the snippet__ through their configuration tool to load the comment system. Copy the snippet for the next step. The resulting snippet should look similar to this: ``` html ``` You can either integrate [Giscus] on every page by overriding the `main.html` template, or create a new template (e.g. `blog.html`) to extend from `main.html` which includes the comment system, so you can decide for each page whether you want to allow comments or not. In order to integrate [Giscus], follow the guide on [theme extension] and [override the `content` block][overriding blocks], extending the default by calling the `super()` function at the beginning of the block: ``` html hl_lines="8" {% extends "base.html" %} {% block content %} {{ super() }}