eosnetworkfoundation / docsgen

Scripts for creating docs.eosnetwork.com pulls from various eos nf repos and builds static HTML to power website
Other
3 stars 0 forks source link

Reenable basic support for i18n locales in docs portal #110

Closed lparisc closed 1 year ago

lparisc commented 1 year ago

Most chinese (and probably other locales) static pages are currently rendering this (React?) error:

"Cannot destructure property 'versions' of 'n' as it is undefined."

AC:

This ticket is High Priority - related to https://github.com/eosnetworkfoundation/devrel/issues/213

ericpassmore commented 1 year ago

During the last redesign JS code was added to generate the Right Side Bar, and that code needed to parse the URL. That parsing broke when the local was added to the URL.

ericpassmore commented 1 year ago

Removing the custom theme created during the redesign solved the issue. Something in the custom theme created by contract developer is preventing multi-local support.

###
# Install Theme Updates
Install_DOC6S_Theme() {
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/components" "${ARG_BUILD_DIR:?}/devdocs/src/"
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/css" "${ARG_BUILD_DIR:?}/devdocs/src/"
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/hooks" "${ARG_BUILD_DIR:?}/devdocs/src/"
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/pages" "${ARG_BUILD_DIR:?}/devdocs/src/"
  #cp -r "${SCRIPT_DIR:?}/../web/docusaurus/src/theme" "${ARG_BUILD_DIR:?}/devdocs/src/"
  cp -r "${SCRIPT_DIR:?}/../web/docusaurus/static" "${ARG_BUILD_DIR:?}/devdocs/"
}
Screenshot 2023-04-20 at 5 12 22 PM
ericpassmore commented 1 year ago

Works when CustomTOC is removed. See image below for image of component.

CustomTOC

Page working with CustomTOC

Screenshot 2023-04-20 at 7 26 32 PM
ericpassmore commented 1 year ago

Fixed, one interesting thing the right side TOC drop down switches to "Next" for non-en locals. The en-local has "latest". Not sure how this drop down is used, it was custom work as part of the redesign.

Screenshot 2023-04-21 at 3 45 02 PM Screenshot 2023-04-21 at 3 45 10 PM
lparisc commented 1 year ago

Fixed, one interesting thing the right side TOC drop down switches to "Next" for non-en locals. The en-local has "latest". Not sure how this drop down is used, it was custom work as part of the redesign.

The same version drop-down should be used for all locales. I'll create another ticket to address this later.