Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing <ul> in single page navigation #251

Merged
merged 1 commit into from
Jul 29, 2021
Merged

Commits on Jul 29, 2021

  1. Fix missing <ul> in single page navigation

    Since the changes made in 30471a9, there’s now no outer <ul> when `multipage_nav` is false – it jumps straight from the `<nav>` to the `<li>`.
    
    Because `multi_page_table_of_contents ` calls `single_page_table_of_contents` via `render_page_tree`, it's not as simple as adding the extra `<ul>` to the existing `single_page_table_of_contents` method, otherwise you end up with duplicate `<ul>` elements in some cases.
    
    Instead, rename the existing `single_page_table_of_contents` to create a new function `list_items_from_headings `. The `list_items_from_headings` method can be called by both `render_page_tree` and a new `single_page_table_of_contents` method which maintains the existing API. This new `single_page_table_of_contents` method can then add the wrapper without affecting the output of `multi_page_table_of_contents`.
    36degrees committed Jul 29, 2021
    Configuration menu
    Copy the full SHA
    4fd4a60 View commit details
    Browse the repository at this point in the history