question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for sections with pages

See original GitHub issue

Currently, a parent nav item (one which contains children) cannot have a page attached to it, as stated in the MkDocs documentation.

This means that in the following navigation structure, I can’t link from other topics to the general “Products” page, which is inconvenient:

nav:
    - Home: index.md
    - Products:
        - Product A: product-a.md
        - Product B: product-a.md
    - Support: support.md

However, as @waylan pointed out in this comment, this could be overriden by a template.

It would be great if material supported waylan’s suggested implementation.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
wilhelmercommented, Feb 27, 2019

Personally I think that collapsibility of sections (especially on mobile) outweighs the need to put your content in a separate page (coming first) in your section.

Typically, yes. But our doc site has a super uncommonly low amount of mobile users (around 1.2%), mainly because it’s usually accessed from a desktop app. So we might think different about that. It always depends.

Anyway, thanks for the insight and the discussion!

1reaction
squidfunkcommented, Feb 26, 2019

Haha that’s the point. Good UX is very hard 😉 Personally I think that collapsibility of sections (especially on mobile) outweighs the need to put your content in a separate page (coming first) in your section. Otherwise mobile navigation might be a lot of scrolling, which can be quite A LOT for huge documentation projects. I currently solve this problem by naming the first page within a section “Overview” or something similar.

It’s always a trade-off, no matter which way you look.

EDIT: Also, note that we would need to implement this as an optional thing, because making it mandatory would mean that there will always need to be an index page. Some people might argue that they don’t want that, because content is mutually exclusive aaaaand we’re back to square one. However, making it optional would only lead to more confusion. I think we should just leave it as it is. If one wants to change it, theme extension is always a possibility.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add and format sections in Pages on Mac - Apple Support
Add a blank section after the current section · In Page Thumbnails view, select any page in a section. · Open the Document...
Read more >
Create pages, sections, or notebooks in OneNote for Mac
At the bottom of the vertical section list, click Add section. On your keyboard, press Command + T. Type a name for the...
Read more >
Add Sections to Your Pages in Square Online
Click the Add section button to view more sections. Scroll through the list and click on any section to see a preview on...
Read more >
Page sections - Squarespace Help Center
Add and edit sections · Click Add Section above or below an existing section. · Click a category in the left panel to...
Read more >
Motion Support: How do I add sections to Pages?
Create a new Page, add a title, and switch the Template setting on the right to page.sections (how to assign a page template)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found