Skip to content

Commit add79ff

Browse files
Document Docusaurus trailingSlash requirement for Read the Docs (#12583)
Docusaurus requires `trailingSlash: true` to be explicitly set to work correctly on Read the Docs. When not set or set to `false`, users must configure redirects manually. ## Changes Added "Configure trailing slashes" section to `/docs/user/intro/docusaurus.rst` explaining: - `trailingSlash: true` must be explicitly configured for proper URL resolution (`/docs/intro` → `/docs/intro/index.html`) - Without this setting (or if set to `false`), manual redirect configuration is required ```js // docusaurus.config.js export default { // Required for compatibility with Read the Docs trailingSlash: true, }; ``` Follows the same pattern as the Markdoc documentation. > [!WARNING] > <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <__filter_complete__></__filter_complete__></details><issue_title>Docs: mention that Docusaurus needs `trailingSlash: true` (default) to work</issue_title> ><issue_description>We are documenting Docusaurus at https://docs.readthedocs.com/platform/latest/intro/docusaurus.html > > We should mention that `trailingSlash: true` is required to work without issues. When it's `false`, the user needs to define a redirect: https://github.com/readthedocs/readthedocs.org/pull/12323</issue_description> > ><agent_instructions>Just update the docs in the docs/user repo</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > ><comments> ></comments> > - Fixes #12345 <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Docs: mention that Docusaurus needs `trailingSlash: true` (default) to work</issue_title> > <issue_description>We are documenting Docusaurus at https://docs.readthedocs.com/platform/latest/intro/docusaurus.html > > We should mention that `trailingSlash: true` is required to work without issues. When it's `false`, the user needs to define a redirect: https://github.com/readthedocs/readthedocs.org/pull/12323</issue_description> > > <agent_instructions>Just update the docs in the docs/user repo</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes #12345 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. Closes #12345 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ericholscher <25510+ericholscher@users.noreply.github.com>
1 parent 45bd0ad commit add79ff

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/user/intro/docusaurus.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,22 @@ For optimal integration with Read the Docs, make the following optional configur
6262
:local:
6363
:backlinks: none
6464

65+
Configure trailing slashes
66+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
67+
68+
For proper operation on Read the Docs, you need to set ``trailingSlash: true`` in your Docusaurus configuration.
69+
This ensures that URLs like ``/docs/intro`` are handled as ``/docs/intro/`` and the corresponding ``index.html`` file is served correctly.
70+
71+
Without this setting (or if set to ``false``), you will need to configure redirects to ensure proper URL resolution.
72+
73+
.. code-block:: js
74+
:caption: docusaurus.config.js
75+
76+
export default {
77+
// Required for compatibility with Read the Docs
78+
trailingSlash: true,
79+
};
80+
6581
Set the canonical URL
6682
~~~~~~~~~~~~~~~~~~~~~
6783

0 commit comments

Comments
 (0)