mkdocs-techdocs-core icon indicating copy to clipboard operation
mkdocs-techdocs-core copied to clipboard

Support for Category-Specific Sidebars to Reduce Artifact Size in MkDocs Monorepo Plugin

Open RaizadaHaroon opened this issue 1 year ago • 2 comments

We are managing documentation for around 100 products in a single repository using the MkDocs Monorepo Plugin. The root mkdocs.yml file utilizes !include to include configuration files for each product.

Current Structure:

mkdocs.yml
products/
    prod1/
        mkdocs.yml
        docs/
            index.md
            topic1.md
            topic2.md
    prod2/
        mkdocs.yml
        docs/
            index.md
            topic1.md
            topic2.md
    # and so on for 100 products
docs/
    index.md

Root mkdocs.yml Configuration:

site_name: 'Main Documentation Site'
nav:
  - Home: index.md
  - Products:
      !include: 'products/prod1/mkdocs.yml'
      !include: 'products/prod2/mkdocs.yml'
      # Add more products as needed
plugins:
  - search
  - monorepo

Concern:

Currently, each rendered HTML page includes the sidebar tree for all 100 products, which significantly increases the artifact size. This is inefficient and can negatively impact the performance and usability of our documentation site.

RaizadaHaroon avatar Jul 01 '24 16:07 RaizadaHaroon

Hi @RaizadaHaroon, It's not clear to me how this can be avoided as you are explicitly adding this as you mention. Can you share what you would like to see done for a case like this?

awanlin avatar Jul 02 '24 12:07 awanlin

he root mkdocs.yml includes 100 product-specific MkDocs configurations. To manage the large sidebar size, we are using the navigation.prune setting to reduce artifact size. However, this leads to an undesired behavior: clicking on a top-level section in the navigation opens the first available page instead of staying on the current page or expanding the section.

RaizadaHaroon avatar Jul 09 '24 20:07 RaizadaHaroon

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 09 '24 01:11 github-actions[bot]