squidfunk / mkdocs-material

Documentation that simply works
https://squidfunk.github.io/mkdocs-material/
MIT License
19.7k stars 3.44k forks source link

Regression in navigation.indexes #3459

Closed SeanTAllen closed 2 years ago

SeanTAllen commented 2 years ago

Contribution guidelines

I've found a bug and checked that ...

Description

Between two builds (one on October 12, 2021) and two, the rendering of navigation for our site changed when using navigation.idexes.

Expected behaviour

Previously (as of October 21 build) with the insiders version of mkdocs-material, our nav bar as rendered thusly:

image

Based on this navigation definition:

nav:
  - Home: "index.md"
  - Getting Started:
      - Overview: "getting-started/index.md"
      - What You Need: "getting-started/what-you-need.md"
      - Hello World -- Your First Pony Program: "getting-started/hello-world.md"
      - Hello World -- How It Works: "getting-started/how-it-works.md"
  - Types:
      - Overview: "types/index.md"
      - The Pony Type System at a Glance: "types/at-a-glance.md"
      - Classes: "types/classes.md"
      - Primitives: "types/primitives.md"
      - Actors: "types/actors.md"
      - Traits and Interfaces: "types/traits-and-interfaces.md"
      - Structs: "types/structs.md"
      - Type Aliases: "types/type-aliases.md"
      - Type Expressions: "types/type-expressions.md"
  - Expressions:
      - Overview: "expressions/index.md"
      - Literals: "expressions/literals.md"
      - Variables: "expressions/variables.md"
      - Operators: "expressions/ops.md"
      - Arithmetic: "expressions/arithmetic.md"
      - Control Structures: "expressions/control-structures.md"
      - Methods: "expressions/methods.md"
      - Errors: "expressions/errors.md"
      - Equality in Pony: "expressions/equality.md"
      - Sugar: "expressions/sugar.md"
      - Object Literals: "expressions/object-literals.md"
      - Partial Application: "expressions/partial-application.md"
  - Reference Capabilities:
      - Overview: "reference-capabilities/index.md"
      - Reference Capabilities: "reference-capabilities/reference-capabilities.md"
      - Reference Capability Guarantees: "reference-capabilities/guarantees.md"
      - Consume and Destructive Read: "reference-capabilities/consume-and-destructive-read.md"
      - Recovering Capabilities: "reference-capabilities/recovering-capabilities.md"
      - Aliasing: "reference-capabilities/aliasing.md"
      - Passing and Sharing References: "reference-capabilities/passing-and-sharing.md"
      - Capability Subtyping: "reference-capabilities/capability-subtyping.md"
      - Combining Capabilities: "reference-capabilities/combining-capabilities.md"
      - Arrow Types aka Viewpoints: "reference-capabilities/arrow-types.md"
      - Reference Capability Matrix: "reference-capabilities/capability-matrix.md"
  - Object Capabilities:
      - Overview: "object-capabilities/index.md"
      - Object Capabilities: "object-capabilities/object-capabilities.md"
      - Derived Authority: "object-capabilities/derived-authority.md"
      - Trust Boundary: "object-capabilities/trust-boundary.md"
  - Generics:
      - Overview: "generics/index.md"
      - Generics and Reference Capabilities: "generics/generics-and-reference-capabilities.md"
      - Constraints: "generics/generic-constraints.md"
  - Pattern Matching:
      - Overview: "pattern-matching/index.md"
      - Match Expressions: "pattern-matching/match.md"
      - As Operator: "pattern-matching/as.md"
  - Packages:
      - Overview: "packages/index.md"
      - Use Statement: "packages/use-statement.md"
      - Standard Library: "packages/standard-library.md"
  - Testing:
      - Overview: "testing/index.md"
      - Testing with PonyTest: "testing/ponytest.md"
  - C-FFI:
      - Overview: "c-ffi/index.md"
      - Calling C from Pony: "c-ffi/calling-c.md"
      - Linking to C Libraries: "c-ffi/linking-c.md"
      - C ABI: "c-ffi/c-abi.md"
      - Callbacks: "c-ffi/callbacks.md"
  - Gotchas:
      - Overview: "gotchas/index.md"
      - Divide by Zero: "gotchas/divide-by-zero.md"
      - Garbage Collection: "gotchas/garbage-collection.md"
      - Scheduling: "gotchas/scheduling.md"
      - Function Call Side Effects: "gotchas/side-effect-ordering-in-function-call-expressions.md"
      - Recursion: "gotchas/recursion.md"
  - Where Next?:
      - Overview: "where-next/index.md"
  - Appendices:
      - Overview: "appendices/index.md"
      - PONYPATH: "appendices/ponypath.md"
      - Lexicon: "appendices/lexicon.md"
      - Symbol Lookup Cheat Sheet: "appendices/symbol-lookup-cheat-sheet.md"
      - Keywords: "appendices/keywords.md"
      - Examples: "appendices/examples.md"
      - Whitespace: "appendices/whitespace.md"
      - Compiler Arguments: "appendices/compiler-args.md"
      - Memory Allocation at Runtime: "appendices/memory-allocation.md"
      - Garbage Collection with Pony-ORCA: "appendices/garbage-collection.md"
      - Platform-dependent Code: "appendices/platform-dependent-code.md"
      - A Short Guide to Pony Error Messages: "appendices/error-messages.md"
      - Program Annotations: "appendices/annotations.md"
      - Serialisation: "appendices/serialisation.md"

Actual behaviour

With some change that has occurred since then, the title for the section like "Getting Started" is replaced with the title of the index page that 'navigation.indexes' folds in. So it has the rather unappealing:

image

Which was not at all expected.

Steps to reproduce

Build the site

Package versions

Doesn't appear to be python version dependent.

Didn't happen with insiders version on October 12. Happens with the version today.

We are git cloning the latest from the insiders repo on each build.

Configuration

site_name: Pony Tutorial

copyright: Copyright © 2021 The Pony Developers
edit_uri: edit/main/docs/
repo_url: https://github.com/ponylang/pony-tutorial/
site_url: https://tutorial.ponylang.io/
use_directory_urls: false

extra:
  generator: false
  social:
    - icon: fontawesome/brands/github
      link: https://github.com/ponylang
    - icon: fontawesome/brands/twitter
      link: https://twitter.com/ponylang

markdown_extensions:
  - pymdownx.highlight
  - pymdownx.smartsymbols
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid-experimental
          format: !!python/name:pymdownx.superfences.fence_code_format
  - smarty
  - toc:
      permalink: true

plugins:
  - search
  - ezlinks
  - htmlproofer:
      raise_error: True
      raise_error_excludes:
        429: ["https://github.com/ponylang"]
        404: ["https://github.com/ponylang"]

theme:
  name: material

  favicon: assets/logo.png

  features:
    - navigation.instant
    - navigation.indexes
    - navigation.tracking
    - search.highlight
    - search.share
    - search.suggest

  icon:
    repo: fontawesome/brands/github

  logo: assets/logo.png

  palette:
    # Light mode
    - scheme: default
      primary: brown
      accent: amber
      toggle:
        icon: material/toggle-switch-off-outline
        name: Switch to dark mode

    # Dark mode
    - scheme: slate
      primary: brown
      accent: amber
      toggle:
        icon: material/toggle-switch
        name: Switch to light mode

nav:
  - Home: "index.md"
  - Getting Started:
      - "getting-started/index.md"
      - What You Need: "getting-started/what-you-need.md"
      - Hello World -- Your First Pony Program: "getting-started/hello-world.md"
      - Hello World -- How It Works: "getting-started/how-it-works.md"
  - Types:
      - Overview: "types/index.md"
      - The Pony Type System at a Glance: "types/at-a-glance.md"
      - Classes: "types/classes.md"
      - Primitives: "types/primitives.md"
      - Actors: "types/actors.md"
      - Traits and Interfaces: "types/traits-and-interfaces.md"
      - Structs: "types/structs.md"
      - Type Aliases: "types/type-aliases.md"
      - Type Expressions: "types/type-expressions.md"
  - Expressions:
      - Overview: "expressions/index.md"
      - Literals: "expressions/literals.md"
      - Variables: "expressions/variables.md"
      - Operators: "expressions/ops.md"
      - Arithmetic: "expressions/arithmetic.md"
      - Control Structures: "expressions/control-structures.md"
      - Methods: "expressions/methods.md"
      - Errors: "expressions/errors.md"
      - Equality in Pony: "expressions/equality.md"
      - Sugar: "expressions/sugar.md"
      - Object Literals: "expressions/object-literals.md"
      - Partial Application: "expressions/partial-application.md"
  - Reference Capabilities:
      - Overview: "reference-capabilities/index.md"
      - Reference Capabilities: "reference-capabilities/reference-capabilities.md"
      - Reference Capability Guarantees: "reference-capabilities/guarantees.md"
      - Consume and Destructive Read: "reference-capabilities/consume-and-destructive-read.md"
      - Recovering Capabilities: "reference-capabilities/recovering-capabilities.md"
      - Aliasing: "reference-capabilities/aliasing.md"
      - Passing and Sharing References: "reference-capabilities/passing-and-sharing.md"
      - Capability Subtyping: "reference-capabilities/capability-subtyping.md"
      - Combining Capabilities: "reference-capabilities/combining-capabilities.md"
      - Arrow Types aka Viewpoints: "reference-capabilities/arrow-types.md"
      - Reference Capability Matrix: "reference-capabilities/capability-matrix.md"
  - Object Capabilities:
      - Overview: "object-capabilities/index.md"
      - Object Capabilities: "object-capabilities/object-capabilities.md"
      - Derived Authority: "object-capabilities/derived-authority.md"
      - Trust Boundary: "object-capabilities/trust-boundary.md"
  - Generics:
      - Overview: "generics/index.md"
      - Generics and Reference Capabilities: "generics/generics-and-reference-capabilities.md"
      - Constraints: "generics/generic-constraints.md"
  - Pattern Matching:
      - Overview: "pattern-matching/index.md"
      - Match Expressions: "pattern-matching/match.md"
      - As Operator: "pattern-matching/as.md"
  - Packages:
      - Overview: "packages/index.md"
      - Use Statement: "packages/use-statement.md"
      - Standard Library: "packages/standard-library.md"
  - Testing:
      - Overview: "testing/index.md"
      - Testing with PonyTest: "testing/ponytest.md"
  - C-FFI:
      - Overview: "c-ffi/index.md"
      - Calling C from Pony: "c-ffi/calling-c.md"
      - Linking to C Libraries: "c-ffi/linking-c.md"
      - C ABI: "c-ffi/c-abi.md"
      - Callbacks: "c-ffi/callbacks.md"
  - Gotchas:
      - Overview: "gotchas/index.md"
      - Divide by Zero: "gotchas/divide-by-zero.md"
      - Garbage Collection: "gotchas/garbage-collection.md"
      - Scheduling: "gotchas/scheduling.md"
      - Function Call Side Effects: "gotchas/side-effect-ordering-in-function-call-expressions.md"
      - Recursion: "gotchas/recursion.md"
  - Where Next?:
      - Overview: "where-next/index.md"
  - Appendices:
      - Overview: "appendices/index.md"
      - PONYPATH: "appendices/ponypath.md"
      - Lexicon: "appendices/lexicon.md"
      - Symbol Lookup Cheat Sheet: "appendices/symbol-lookup-cheat-sheet.md"
      - Keywords: "appendices/keywords.md"
      - Examples: "appendices/examples.md"
      - Whitespace: "appendices/whitespace.md"
      - Compiler Arguments: "appendices/compiler-args.md"
      - Memory Allocation at Runtime: "appendices/memory-allocation.md"
      - Garbage Collection with Pony-ORCA: "appendices/garbage-collection.md"
      - Platform-dependent Code: "appendices/platform-dependent-code.md"
      - A Short Guide to Pony Error Messages: "appendices/error-messages.md"
      - Program Annotations: "appendices/annotations.md"
      - Serialisation: "appendices/serialisation.md"

System information

Happens across browers.

SeanTAllen commented 2 years ago

Source for the site is here: https://github.com/ponylang/pony-tutorial Live site that we rolled back with Netlify is: https://tutorial.ponylang.io/

squidfunk commented 2 years ago

Thanks for reporting. I was first astonished that you see this happening, as I'm using section index pages on the documentation not seeing this happening, but then I realized that it seems to be related to collapsible sections. I'm only using them with second-level sections. I'll look into it.

Edit: happens for sections as well, I just had them all named as the h1 in the documents which is picked up.

squidfunk commented 2 years ago

Fixed in 46f5f30cb. I already fixed that case for navigation tabs before, so it was quite simple to port it to the main navigation. I've tested the repository you mentioned, looking good:

screenshot-localhost-8000-1642324986576

SeanTAllen commented 2 years ago

Awesome. Thank you for the quick turnaround Martin.

squidfunk commented 2 years ago

Released as part of 8.1.7+insiders-4.6.1