mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-23 11:32:22 -06:00
* Remove "passive" toggle PR #1244 introduced the "passive" toggle, but just-the-docs.js subsequently disabled the only styling that used it, so it became redundant. This removes it. * Reduce build time for page-dependent CSS Fix #1323 - Remove `_includes/head_nav.html`. - Generate page-independent SCSS in `assets/css/just-the-docs-head-nav.css`. - Link to `/assets/css/just-the-docs-head-nav.css` in `head.html`. - Disable the above stylesheet in `assets/js/just-the-docs.js`. - Generate page-dependent CSS in `_includes/css/activation.scss.liquid` and include in `head.html`. * No override svg rotate * Disable both stylesheets safely * Move the site nav to a new include - Fix the complete site nav - Move the site nav to `_includes/site_nav.html` - Cache the site nav - Uncache `nav.html` * Move nav and site_nav to _includes/components * Replace id prefix * Update breadcrumbs.html Replace several filters by a single loop through all the pages, but breaking as soon as possible. Profiling indicates that this saves up to 50% of the breadcrumbs build time for the filters. * Update just-the-docs-head-nav.css Adjust the number of lines to keep * Update head.html Remove superflous type. * Update activation.scss.liquid Remove a superfluous closing brace. Adjust layout. * Use `scssify` to remove nesting Preliminary profiling indicates that using `scssify` on the small number of nested CSS rules produced by `activation.scss.liquid` is quick enough. * Update head.scss Manual attempt at prettier (pending installation in Atom). * Avoid generation of nested CSS Local profiling indicated that using `scssify` on each page takes about 1% of the build time. - Update `_includes/css/activation.scss.liquid` to generate non-nested CSS. - Remove use of `scssify` from `_includes/head.html`. * Ignore false positives from validator Ignores: `:1.810-1.823: error: CSS: Parse Error.` and `:1.811-1.824: error: CSS: Parse Error.`; had to shift things around since the local config overrides the CI flag. * Inline `_sass/head.css` * Update CHANGELOG.md --------- Co-authored-by: Matthew Wang <matt@matthewwang.me>
52 lines
1.6 KiB
HTML
52 lines
1.6 KiB
HTML
{%- comment -%}
|
|
Include as: {%- include components/breadcrumbs.html -%}
|
|
Depends on: page, site.
|
|
Results in: HTML for the breadcrumbs component.
|
|
Overwrites:
|
|
node, pages_list, parent_page, grandparent_page.
|
|
{%- endcomment -%}
|
|
|
|
{%- if page.url != "/" and page.parent -%}
|
|
|
|
{%- assign pages_list = site[page.collection] | default: site.html_pages -%}
|
|
|
|
{%- assign parent_page = nil -%}
|
|
{%- assign grandparent_page = nil -%}
|
|
|
|
{%- for node in pages_list -%}
|
|
|
|
{%- if node.has_children and page.grand_parent -%}
|
|
|
|
{%- if node.title == page.parent and node.parent == page.grand_parent -%}
|
|
{%- assign parent_page = node -%}
|
|
{%- endif -%}
|
|
{%- if node.title == page.grand_parent -%}
|
|
{%- assign grandparent_page = node -%}
|
|
{%- endif -%}
|
|
{%- if parent_page and grandparent_page -%}
|
|
{%- break -%}
|
|
{%- endif -%}
|
|
|
|
{%- elsif node.has_children and node.title == page.parent and node.parent == nil -%}
|
|
|
|
{%- assign parent_page = node -%}
|
|
{%- break -%}
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endfor -%}
|
|
|
|
<nav aria-label="Breadcrumb" class="breadcrumb-nav">
|
|
<ol class="breadcrumb-nav-list">
|
|
{% if page.parent -%}
|
|
{%- if page.grand_parent %}
|
|
<li class="breadcrumb-nav-list-item"><a href="{{ grandparent_page.url | relative_url }}">{{ page.grand_parent }}</a></li>
|
|
{%- endif %}
|
|
<li class="breadcrumb-nav-list-item"><a href="{{ parent_page.url | relative_url }}">{{ page.parent }}</a></li>
|
|
{% endif -%}
|
|
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
|
|
</ol>
|
|
</nav>
|
|
|
|
{%- endif -%}
|