diff --git a/_frontend/entrypoints/application.css b/_frontend/entrypoints/application.css index 53c8ed7..66b07cf 100644 --- a/_frontend/entrypoints/application.css +++ b/_frontend/entrypoints/application.css @@ -107,6 +107,10 @@ max-width: 75ch; } +.documentation.no-sidebar > article { + max-width: none; +} + .documentation > article > header { margin-bottom: 2rem; padding-bottom: 1.5rem; diff --git a/_layouts/toc-type.html b/_layouts/toc-type.html index 3f061c2..fa724fc 100644 --- a/_layouts/toc-type.html +++ b/_layouts/toc-type.html @@ -1,22 +1,27 @@ --- layout: default --- -
+{% comment %}Determine if a sidebar section matches the current page{% endcomment %} +{% assign current_section = nil %} +{% for section in site.data.navigation_sidebar.sections %} + {% assign _matched = false %} + {% if section.match_list %} + {% for m in section.match_list %} + {% if page.url contains m %}{% assign _matched = true %}{% break %}{% endif %} + {% endfor %} + {% elsif section.match %} + {% if page.url contains section.match %}{% assign _matched = true %}{% endif %} + {% endif %} + {% if _matched %}{% assign current_section = section %}{% break %}{% endif %} +{% endfor %} +{% assign _has_sidebar = true %} +{% unless current_section %}{% assign _has_sidebar = false %}{% endunless %} + +
+ {% if _has_sidebar %}
+ {% endif %}