mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 03:10:39 -07:00
Scroll to the current section in the sidebar
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<nav class="sidebar__nav">
|
<nav class="sidebar__nav">
|
||||||
<div class="sidebar__nav-interior">
|
<div class="sidebar__nav-interior">
|
||||||
{%- for section in sections -%}
|
{%- for section in sections -%}
|
||||||
<h3 class="section__header">{{ section | capitalize }}</h3>
|
<h3 class="section__header" id="{{ section }}">{{ section | capitalize }}</h3>
|
||||||
|
|
||||||
<ul class="section__links">
|
<ul class="section__links">
|
||||||
{%- for item in site[section] -%}
|
{%- for item in site[section] -%}
|
||||||
@@ -23,5 +23,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{%- if sections contains page.collection -%}
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.getElementById("{{ page.collection }}").scrollIntoView();
|
||||||
|
</script>
|
||||||
|
{%- endif -%}
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user