backstage / mkdocs-techdocs-core

The core MkDocs plugin used by Backstage's TechDocs as a wrapper around multiple MkDocs plugins and Python Markdown extensions
Apache License 2.0
83 stars 61 forks source link

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

Open RaizadaHaroon opened 3 days ago

RaizadaHaroon commented 3 days ago

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.

awanlin commented 2 days ago

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?