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