Skip to content

smart section titles when no navigation is configured #3356

Open
mkdocs-ng/mkdocs
#54

Description

@realtimeprojects

Given no navigation tree is defined in the configuration, the section titles for sub-directories should be determined by the following logic:

  • if an index page is defined, use the title of the index page, hereby the title from the meta data of the index page should be prefered to the title from the markdown in order to allow using a different title than the actual page title for the navigation menu.
  • If no index page is defined, keep the logic "as-is".

The user should be able to turn on/off this behaviour by a configuration option, e.g.

theme:
  features:
    - navigation.smart-section-titles

Activity

  1. zinizhu commented on Sep 6, 2023

    @zinizhu

    +1 to this feature, the default section titles are not ideal, it's also hard to sort the directory order.

  2. lovelydinosaur commented on Apr 15, 2024

    @lovelydinosaur
    Collaborator

    Perhaps you could provide a short example?

  3. realtimeprojects commented on Apr 20, 2024

    @realtimeprojects
    Author

    This repository contains a simple example:

    https://github.com/realtimeprojects/mkdocs-sample/tree/master

    This is how the page looks like at the moment:

    Screen Shot 2024-04-20 at 15 18 23

    Given the feature smart_section_titles is enabled, the page should look like this:

    Screen Shot 2024-04-20 at 15 17 31
  4. realtimeprojects commented on Apr 20, 2024

    @realtimeprojects
    Author

    Here is the PR with a basic implementation:
    #3656

  5. oprypin commented on Apr 20, 2024

    @oprypin
  6. oprypin commented on Apr 20, 2024

    @oprypin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions