-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for multiple tables of contents in the Solidus Guides #3093
Commits on Feb 8, 2019
-
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.
Configuration menu - View commit details
-
Copy full SHA for 661a112 - Browse repository at this point
Copy the full SHA 661a112View commit details -
Configuration menu - View commit details
-
Copy full SHA for 16433ba - Browse repository at this point
Copy the full SHA 16433baView commit details
Commits on Feb 11, 2019
-
Configuration menu - View commit details
-
Copy full SHA for be528b8 - Browse repository at this point
Copy the full SHA be528b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89d6a8b - Browse repository at this point
Copy the full SHA 89d6a8bView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 40f4087 - Browse repository at this point
Copy the full SHA 40f4087View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 5e12b30 - Browse repository at this point
Copy the full SHA 5e12b30View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 50a196b - Browse repository at this point
Copy the full SHA 50a196bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 360c215 - Browse repository at this point
Copy the full SHA 360c215View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 8935165 - Browse repository at this point
Copy the full SHA 8935165View commit details -
Allow guides nav to be used without a title
This was raising an error in the middleman console
Configuration menu - View commit details
-
Copy full SHA for 7eea7d8 - Browse repository at this point
Copy the full SHA 7eea7d8View commit details -
Fix source/users/products/product-stock access
by renaming product-stock.md into product-stock.html.md
Configuration menu - View commit details
-
Copy full SHA for 304cc53 - Browse repository at this point
Copy the full SHA 304cc53View commit details -
Configuration menu - View commit details
-
Copy full SHA for 27d8703 - Browse repository at this point
Copy the full SHA 27d8703View commit details -
Configuration menu - View commit details
-
Copy full SHA for 21eaa60 - Browse repository at this point
Copy the full SHA 21eaa60View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for d693204 - Browse repository at this point
Copy the full SHA d693204View commit details -
Configuration menu - View commit details
-
Copy full SHA for f60361d - Browse repository at this point
Copy the full SHA f60361dView commit details -
Adjust page titles to work with several TOC
It also please Rubocop by removing Ruby 2.3 syntax which makes Hound to complain.
Configuration menu - View commit details
-
Copy full SHA for 368a4fe - Browse repository at this point
Copy the full SHA 368a4feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 97b676f - Browse repository at this point
Copy the full SHA 97b676fView commit details