Merge pull request #1121 from ZakCodes/scroll-to-section

Scroll to the section of the page
This commit is contained in:
Justin Li
2019-08-06 19:23:57 -04:00
committed by GitHub
+7 -1
View File
@@ -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>