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

Add support for multiple tables of contents in the Solidus Guides #3093

Merged
merged 17 commits into from
Feb 15, 2019

Commits on Feb 8, 2019

  1. Move current /index.html to /developers/index.html

    As we gain multiple guides (e.g. Developers Guide, User Guide, API
    Guide), the /index.html should be reserved as a landing page.
    
    Instead of using /index.html while the Solidus Guides are only the
    Solidus Developers Guide, let's redirect the homepage to
    /developers/index.html.
    benjaminwil authored and kennyadsl committed Feb 8, 2019
    Configuration menu
    Copy the full SHA
    661a112 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    16433ba View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2019

  1. Extract helpers from config.rb

    benjaminwil authored and kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    be528b8 View commit details
    Browse the repository at this point in the history
  2. Remove unused custom_helpers

    benjaminwil authored and kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    89d6a8b View commit details
    Browse the repository at this point in the history
  3. Add helpers to render multiple tables of contents

    This commit adds helper methods that will make rendering different
    tables of contents on different parts of the site easy.
    
    This also updates the discover_title helper to account for multiple
    tables of contents.
    
    \## Dealing with multiple tables of contents
    
    For example, if I visit the following URL:
    
    `localhost:4567/developers/orders/overview.html`
    
    I should see the table of contents for the "Solidus Developers Guide".
    And if I visit this URL:
    
    `localhost:4567/users/promotions/overview.html`
    
    I should see the table of contents for the "Solidus Users Guide".
    
    Here's a description of the helpers's functionality:
    
    \## table_of_contents
    
    The table_of_contents helper allows you to determine which table of
    contents should be rendered. If the user is viewing a URL with the
    subdirectory `/developers/`, then the current table of contents will be
    at the `/data/nav/developers.yml` YAML file.
    
    \## current_guide
    
    the current_guide helper finds which guide the user is viewing. If they
    are a URL with the subdirectory `/developers/`, then the current guide
    is the "Solidus Developers Guide".
    
    The current_guide returns the YAML at `/data/nav/global.yml` which
    allows you to get the `current_guide.title` and `current_guide.href` for
    the current guide.
    benjaminwil authored and kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    40f4087 View commit details
    Browse the repository at this point in the history
  4. Render multiple tables of contents

    This commit enables multiple table of contents rendering for the Solidus
    Guides.
    
    Each table of contents can have as many "submenus" as you want. Here is
    the YAML structure for a short submenu:
    
    ```
    -
      - title: "Section name"
        dropdown:
          - title: "Article name"
            href: "/relative/link/to/article.html"
          - title: "Another article name"
            href: "/relative/link/to/another-article.html"
    ```
    
    Things you should note about the structure:
    
    - Each submenu is represented by a root `-` node that is unnamed.
    - Each submenu can have multiple sections and multiple articles.
    - Articles need to be included in a `dropdown:` at this point in time.
    
    \## Global and Meta tables of contents
    
    The `/data/nav/global.yml` and `/data/nav/meta.yml` do not follow this
    data structure.  These are special menus that will be used throughout
    the site and should not be rendered only when the user is on specific
    pages.
    benjaminwil authored and kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    5e12b30 View commit details
    Browse the repository at this point in the history
  5. Style links to table of contents indexes

    Each table of contents provides a link to the `current_guide.href`. In
    the case of the "Solidus Developers Guide" table of contents, that links
    to `/developers/index.html`.
    
    These links should be styled to look like the <h1> of the table of
    contents block. This is similar to how the title of a blog is usually
    the color of a heading or the site's logo, not the color of a link.
    benjaminwil authored and kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    50a196b View commit details
    Browse the repository at this point in the history
  6. Remove unused CSS

    benjaminwil authored and kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    360c215 View commit details
    Browse the repository at this point in the history
  7. Configure guides /users/ pages to be accessible via extension

    It allows to access page as users/page.html instead of users/page
    like we do into other sections.
    kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    8935165 View commit details
    Browse the repository at this point in the history
  8. Allow guides nav to be used without a title

    This was raising an error in the middleman console
    kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    7eea7d8 View commit details
    Browse the repository at this point in the history
  9. Fix source/users/products/product-stock access

    by renaming product-stock.md into product-stock.html.md
    kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    304cc53 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    27d8703 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    21eaa60 View commit details
    Browse the repository at this point in the history
  12. Add a new main navigation to switch guides

    This is needed to switch between Developers and Users guides. This
    commit also changes the header structure a bit to accomodate this
    new navigation.
    kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    d693204 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f60361d View commit details
    Browse the repository at this point in the history
  14. Adjust page titles to work with several TOC

    It also please Rubocop by removing Ruby 2.3 syntax which makes
    Hound to complain.
    kennyadsl committed Feb 11, 2019
    Configuration menu
    Copy the full SHA
    368a4fe View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    97b676f View commit details
    Browse the repository at this point in the history