docusaurus-discourse-embed-plugin v1.6.0
Docusaurus Discourse Embed Plugin
This plugin embeds Discourse comments right after the main content in your Docusaurus docs pages, preserving the original page structure including footer navigation. It supports both Docusaurus v2 and v3.
Installation
npm install docusaurus-discourse-embed-plugin
Usage
Add the plugin to your docusaurus.config.js
:
module.exports = {
// ... other config options
plugins: [
[
'docusaurus-discourse-embed-plugin',
{
discourseUrl: 'https://your-discourse-instance.com',
discourseEmbedUsername: 'your-discourse-username',
},
],
],
};
Replace 'https://your-discourse-instance.com'
with your actual Discourse URL and 'your-discourse-username'
with the appropriate username for topic creation.
Options
discourseUrl
: The URL of your Discourse instancediscourseEmbedUsername
: The username to use for creating topics in Discourse
How it works
This plugin injects the Discourse embed code into your doc pages right after the main content, preserving the original page structure including footer navigation. It uses a custom Content wrapper to achieve this placement.
Styling
The comments section is wrapped in a div with the class discourseCommentsWrapper
. You can customize its appearance in your own CSS by targeting this class.
Troubleshooting
If you encounter any issues with the plugin, please ensure you have cleared your Docusaurus build cache and rebuilt your site. If problems persist, check your browser console for any error messages related to the Discourse embed script.
License
MIT