Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use the nav tag instead of the ul class? #150

Open
metapodcod opened this issue Nov 14, 2021 · 1 comment
Open

How can I use the nav tag instead of the ul class? #150

metapodcod opened this issue Nov 14, 2021 · 1 comment

Comments

@metapodcod
Copy link

metapodcod commented Nov 14, 2021

<ul id="toc" class="section-nav">
  <li class="toc-entry toc-h1"><a href="#heading1">Heading.1</a>
    <ul>
      <li class="toc-entry toc-h2"><a href="#heading1-1">Heading.1-1</a></li>
      <li class="toc-entry toc-h2"><a href="#heading1-2">Heading.1-2</a></li>
    </ul>
  </li>
</ul>

I want to use it like this but I don't know how, can you help me ?

<nav id="toc" class="section-nav">
<li class="toc-entry toc-h2"><a href="#heading1-1">Heading.1-1</a></li>
 <li class="toc-entry toc-h2"><a href="#heading1-2">Heading.1-2</a></li>
</nav>
@y377
Copy link

y377 commented Jan 9, 2023

<nav id="toc" class="section-nav">
<li class="toc-entry toc-h2"><a href="#heading1-1">Heading.1-1</a></li>
 <li class="toc-entry toc-h2"><a href="#heading1-2">Heading.1-2</a></li>
</nav>

Refer to the HTML5 specification. For links with navigation (including top site navigation and page navigation), use <nav>
<nav>: The Navigation Section element

image
I think I see what you mean. The above is a misunderstanding

try this:

    <nav class="nav" aria-label="Document directory">
        {% toc %}
    </nav>
    {{ content }}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants