4

On a Docusaurus Site, it seems that any page will simply display the site title in the browser tab, but once you get down to the doc level, the browser tab does reflect the title of the page (doc) you are on.

Because the title of the doc is what gets displayed in the browser tab (and because the title of the site is what is displayed in the browser tab for all pages), I have been searching for places to set a "title" for the pages, but I either have not found the correct place to set the title or that is not the answer.

I have also tried setting the browser tab text in a more conventional way (like using document.title), but I am told that the document object cannot be found.

I feel like there has to be a place that says "anything that is of type page should display this text in the browser tab" (or just "the browser tab should display ___ text") but I've been unable to locate that code...

Has anyone dealt with this before?

Kelsey
  • 61
  • 3

1 Answers1

2

I found this merged PR: https://github.com/facebook/docusaurus/pull/704


The answer is to put:

*yourPageName*.title = "Your Desired Titile";

just above the module.exports at the end of the page.

Kelsey
  • 61
  • 3