Skip to content

Commit

Permalink
moved toc below navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mawex committed Apr 13, 2024
1 parent 7c50610 commit 9485075
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pages/_.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
<aside v-if="!article.hideSidebar">
<div class="sticky">
<div class="sidebar">
<nuxt-link v-for="article in sidebarArticles" :key="article.path" class="button" :to="article.path">
{{ article.sidebarTitle || article.title }}
</nuxt-link>
<ul v-if="article.toc.length > 0" class="toc">
<li v-for="link of article.toc" :key="link.id">
<nuxt-link :to="`#${link.id}`" class="item" :class="`indent-${link.depth - minTocLevel}`">
{{ link.text }}
</nuxt-link>
</li>
</ul>
<nuxt-link v-for="article in sidebarArticles" :key="article.path" class="button" :to="article.path">
{{ article.sidebarTitle || article.title }}
</nuxt-link>
</div>
</div>
</aside>
Expand Down Expand Up @@ -119,20 +119,20 @@
.sticky {
position: sticky;
margin-top: 1em;
top: 0;
top: 1em;
.sidebar {
display: flex;
flex-direction: column;
max-height: 100vh;
.toc {
list-style: none;
padding-left: 0;
padding-bottom: 1em;
margin-bottom: 1em;
border-bottom: 1px solid var(--color-background-light);
transition: border-bottom-color 200ms;
padding-top: 1em;
margin-top: 1em;
border-top: 1px solid var(--color-background-light);
transition: border-top-color 200ms;
.item {
display: block;
Expand Down

0 comments on commit 9485075

Please sign in to comment.