Skip to content

Commit

Permalink
docs: fix aside toc for elements pages
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroedin committed Jun 4, 2024
1 parent b171a1b commit 43a41bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions docs/_includes/layouts/pages/basic.njk
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ importElements:
{% include 'partials/component/sidenav.njk' %}
<main id="main">

<article {% if hasToc %}class="has-toc"{% endif %}>
<article {% if hasToc and (content | toc).length > 0 %}class="has-toc"{% endif %}>

{% include 'partials/component/header.njk' %}
{% if hasToc %}
{% if hasToc and (content | toc).length > 0 %}
<aside>
{% if (content | toc).length > 0 %}
<uxdot-toc summary="On this page">
{{ content | toc | safe }}
</uxdot-toc>
{% endif %}
<uxdot-toc summary="On this page">
{{ content | toc | safe }}
</uxdot-toc>
</aside>
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions docs/elements/elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
{% include 'partials/component/masthead.njk' %}
{% include 'partials/component/sidenav.njk' %}
<main id="main">
<article>
<article {% if hasToc and (content | toc).length > 0 %}class="has-toc"{% endif %}>
<uxdot-header has-subnav>
<h1 id="{{ doc.slug }}" class="page-title">{{ doc.alias or (doc.slug | deslugify) }}</h1>
<rh-subnav slot="subnav">{% for tab in doc.tabs %}
Expand All @@ -63,7 +63,7 @@ <h1 id="{{ doc.slug }}" class="page-title">{{ doc.alias or (doc.slug | deslugify
</rh-subnav>
</uxdot-header>

{% if hasToc %}
{% if hasToc and (content | toc).length > 0 %}
<aside>
{{ content | toc | safe }}
</aside>
Expand Down

0 comments on commit 43a41bc

Please sign in to comment.