Skip to content

Commit

Permalink
🗺 Ability to hide outline (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Aug 12, 2023
1 parent 5489cf8 commit e8f58e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-dryers-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@myst-theme/book': patch
---

Bring back outline hiding
9 changes: 5 additions & 4 deletions themes/book/app/routes/$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
useOutlineHeight,
useTocHeight,
DocumentOutline,
DEFAULT_NAV_HEIGHT,
Navigation,
TopNav,
ArticlePageCatchBoundary,
Expand Down Expand Up @@ -105,9 +104,11 @@ export default function Page() {
return (
<ArticlePageAndNavigation hide_toc={hide_toc} projectSlug={article.project}>
<main ref={container} className="article-grid subgrid-gap col-screen">
<div className="sticky z-10 hidden h-0 col-margin-right-inset lg:block" style={{ top }}>
<DocumentOutline top={16} className="relative" outlineRef={outline} />
</div>
{!hide_outline && (
<div className="sticky z-10 hidden h-0 col-margin-right-inset lg:block" style={{ top }}>
<DocumentOutline top={16} className="relative" outlineRef={outline} />
</div>
)}
<ArticlePage article={article} hide_all_footer_links={hide_footer_links} showAbstract />
</main>
</ArticlePageAndNavigation>
Expand Down

0 comments on commit e8f58e7

Please sign in to comment.