2

My understanding is that the docusuarus.config.js file essentially translates the defined info into HTML that builds your website. The file the translated info goes to is the 'index.html' file.

However, my footer (and a few other components) in my config.js file will not reflect in the index.html file. For example, in my docusuarus.config.js file, I have defined a footer:

 footer: {
        copyright: `<b>Unless otherwise noted, all files contained herein are X Company, Inc., Proprietary and Confidential Information.</b>
        <br/><br/>
        Copyright © ${new Date().getFullYear()} Company, Version 1.00`,

This footer worked before I modified the homepage index.js file. It seems the index.js file is overriding some things.

In my index.html file, this is the defined footer:

footer class="footer"><div class="container container-fluid">
<div class="footer__bottom text--center">
<div class="footer__copyright">
Copyright © 2024 My Project, Inc. Built with Docusaurus.</div></div></div></footer></div>

Note the Copyright © 2024 My Project, Inc. Built with Docusaurus. That copy is not defined anywhere in my site files. That is the default footer copy.

So, for some reason, Docusaurus is reverting to default copy, and some information in my docusaurus.config.js is being ignored.

I have not found a resource that documents this issue as explicitly as: "My index.html file is ignoring or not receiving info from my docusaurus.config.js file."

I had this problem on a site I was working on and assumed the site was corrupt. So, I started a new one and now I have the same problem.

I don't prefer the idea of deleting the index.js file, which I have seen suggested. That file is useful and hasn't been problematic before.

I tried:

  • Updating Node versions
  • Restarting the development server
  • Starting fresh Docusaurus site
  • Rebuilding the site
  • Comparing old sites that have works (no discernible difference)
2
  • what is docusaurus version? Commented Jul 10 at 8:31
  • @MaksatRahmanov — is 20.13.1
    – JRHaus
    Commented Jul 10 at 15:10

1 Answer 1

1

Found my problem. I blame ignorance.

I post described a problem I have not experienced before, which is why I found it so odd.

Real Problem: i18n files overriding content defined in my docusaurus.config.js.

The docusaurus-theme content in the i18n\locale folders were overriding my config file. This included:

  • Footer content
  • Navbar content
  • Site Title
  • (maybe other stuff)

For whatever reason, the i18n files were out of sync with my current theme files and that caused the info defined in my docusaurus.config.js file to be overridden (to some extent; some stuff was fine).

Solution: Deleted i18n Content, Re-Copied Current Content to i18n File Locales

Deleted all folders/content in i18n folder. Kept i18n folder. Re-copied all current website docs, blogs, pages, themes to i18n locales to rebuild i18n locales with current content.

[create folder/copy theme content]
npm run write-translations -- --locale fr

[create folder/copy docs files]
mkdir -p i18n/fr/docusaurus-plugin-content-docs/current
cp -r docs/** i18n/fr/docusaurus-plugin-content-docs/current

[create folder/copy blog content]
mkdir -p i18n/fr/docusaurus-plugin-content-blog
cp -r blog/** i18n/fr/docusaurus-plugin-content-blog

[create folder/copy pages content]
mkdir -p i18n/fr/docusaurus-plugin-content-pages
cp -r src/pages/**.md i18n/fr/docusaurus-plugin-content-pages
cp -r src/pages/**.mdx i18n/fr/docusaurus-plugin-content-pages

I don't know how this hasn't impacted me before. It makes sense why I couldn't find what was overriding my config file. Checking the i18n assets was literally last on my list!

Not the answer you're looking for? Browse other questions tagged or ask your own question.