jekyll-toc icon indicating copy to clipboard operation
jekyll-toc copied to clipboard

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

Open metapodcod opened this issue 2 years ago • 1 comments

<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>

metapodcod avatar Nov 14 '21 11:11 metapodcod

<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

y377 avatar Jan 09 '23 04:01 y377