Skip to content

Commit

Permalink
Merge pull request #4 from datasektionen/sidebar
Browse files Browse the repository at this point in the history
Filter sidebar on header levels
  • Loading branch information
Herkarl authored Mar 28, 2024
2 parents ed6a766 + 1b28fdb commit 0e716d4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion templates/_default.nunj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,17 @@
<h2>På den här sidan</h2>
<ul>
{% for anchor in anchors %}
<li><a href="#{{ anchor.id }}">{{ anchor.value }}</a></li>
{% if anchor.level < 3 %}
<li style="list-style-type: none;">
<a href="#{{ anchor.id }}">
{% if anchor.level == 1 %}
<span style="font-weight: bold;"> {{ anchor.value }} </span>
{% else %}
<span style="margin-left: 1.5rem;"> {{ anchor.value }}</span>
{% endif %}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
Expand Down

0 comments on commit 0e716d4

Please sign in to comment.