diff options
author | 2021-07-15 14:13:35 -0400 | |
---|---|---|
committer | 2021-07-15 14:13:35 -0400 | |
commit | 166e22bdf35b9751dc42f5cc6cb27a99b077df93 (patch) | |
tree | e8643360c2250dda82ebf95b62281978547d5188 /docs/src/components/SiteSidebar.astro | |
parent | fb8bf7ec43f7b09348c12d5ff9f81131c70ef5e9 (diff) | |
download | astro-166e22bdf35b9751dc42f5cc6cb27a99b077df93.tar.gz astro-166e22bdf35b9751dc42f5cc6cb27a99b077df93.tar.zst astro-166e22bdf35b9751dc42f5cc6cb27a99b077df93.zip |
merge in docs site (#705)
Diffstat (limited to 'docs/src/components/SiteSidebar.astro')
-rw-r--r-- | docs/src/components/SiteSidebar.astro | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/docs/src/components/SiteSidebar.astro b/docs/src/components/SiteSidebar.astro new file mode 100644 index 000000000..6d003d71d --- /dev/null +++ b/docs/src/components/SiteSidebar.astro @@ -0,0 +1,69 @@ +--- +import { sidebar } from '../config.ts'; +const {currentPage} = Astro.props; +--- + + +<nav> + <ul class="nav-groups"> + {sidebar.map(category => ( + <li> + <div class="nav-group"> + <h2 class="nav-group-title">{category.text}</h2> + <ul> + {category.children.map(child => ( + <li class={`nav-link ${currentPage === child.link ? 'is-active' : ''}`}><a href={`${Astro.site.pathname}${child.link}`}>{child.text}</a></li> + ))} + </ul> + </div> + </li> + ))} + </ul> +</nav> + +<style> + nav { + position: sticky; + min-height: calc(100vh - 3.5rem); + height: calc(100vh - 3.5rem); + top: 3.5rem; + } + .nav-groups { + height: 100%; + padding: 2rem 0; + overflow: auto; + } + + .nav-groups > li + li { + margin-top: 2rem; + } + + .nav-group-title { + font-size: 1.0rem; + font-weight: 700; + padding: 0.1rem 2rem; + text-transform: uppercase; + margin-bottom: 0.5rem; + } + + .nav-link a { + font-size: 1.0rem; + margin: 1px; + padding: 0.3rem 2rem; + font: inherit; + color: inherit; + text-decoration: none; + display: block; + } + .nav-link a:hover, + .nav-link a:focus { + background-color: var(--theme-bg-hover); + } + + .nav-link.is-active a { + color: var(--theme-text-accent); + background-color: var(--theme-bg-accent); + font-weight: 600; + } + +</style>
\ No newline at end of file |