summaryrefslogtreecommitdiff
path: root/docs/src/components/LeftSidebar/LeftSidebar.astro
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src/components/LeftSidebar/LeftSidebar.astro')
-rw-r--r--docs/src/components/LeftSidebar/LeftSidebar.astro186
1 files changed, 0 insertions, 186 deletions
diff --git a/docs/src/components/LeftSidebar/LeftSidebar.astro b/docs/src/components/LeftSidebar/LeftSidebar.astro
deleted file mode 100644
index a37b04d53..000000000
--- a/docs/src/components/LeftSidebar/LeftSidebar.astro
+++ /dev/null
@@ -1,186 +0,0 @@
----
-import { SIDEBAR } from '../../config.ts';
-import {
- getLanguageFromURL,
- removeLeadingSlash,
- removeTrailingSlash,
-} from '../../util.ts';
-const { currentPage } = Astro.props;
-
-// Get the slug w/o a leading or trailing slash
-const currentPageMatch = removeLeadingSlash(removeTrailingSlash(currentPage));
-const langCode = getLanguageFromURL(currentPage);
-// SIDEBAR is a flat array. Group it by sections to properly render.
-const sidebarSections = SIDEBAR[langCode].reduce((col, item) => {
- if (item.header) {
- col.push({ ...item, children: [] });
- } else {
- col[col.length - 1].children.push(item);
- }
- return col;
-}, []);
----
-
-<nav aria-labelledby="grid-left">
- <ul class="nav-groups">
- <li>
- <div class="nav-group">
- <h2 class="sponsors-title">Sponsored by</h2>
- <div class="sponsors">
- <a href="https://www.netlify.com/" aria-label="Go to Netlify website">
- <svg
- class="sponsor-logo__netlify"
- viewBox="0 0 147 40"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- ><radialGradient
- id="netlify-gradient"
- cx="-779.0521"
- cy="1839.7205"
- gradientTransform="matrix(0 38.301 44.1228 0 -81154.2578 29839.2441)"
- gradientUnits="userSpaceOnUse"
- r="1.0011"
- ><stop offset="0" stop-color="#20c6b7"></stop><stop
- offset="1"
- stop-color="#4d9abf"></stop></radialGradient
- ><path
- clip-rule="evenodd"
- d="m53.37 12.98.12 2.2c1.4-1.7 3.24-2.55 5.53-2.55 3.95 0 5.96 2.27 6.03 6.8v12.57h-4.26v-12.32c0-1.21-.26-2.1-.78-2.68s-1.37-.87-2.55-.87c-1.72 0-3 .78-3.84 2.34v13.53h-4.26v-19.02zm24.38 19.37c-2.7 0-4.89-.85-6.57-2.56-1.68-1.7-2.52-3.98-2.52-6.81v-.53c0-1.9.36-3.59 1.1-5.09.73-1.49 1.76-2.66 3.08-3.49s2.79-1.25 4.42-1.25c2.58 0 4.58.83 5.99 2.48s2.11 3.99 2.11 7.01v1.72h-12.4c.13 1.57.65 2.81 1.57 3.73s2.07 1.37 3.46 1.37c1.95 0 3.54-.79 4.77-2.37l2.3 2.2c-.76 1.14-1.77 2.02-3.04 2.65s-2.69.94-4.27.94zm-.51-16.29c-1.17 0-2.11.41-2.83 1.23s-1.18 1.96-1.38 3.43h8.12v-.32c-.09-1.43-.47-2.51-1.14-3.24-.67-.74-1.59-1.1-2.77-1.1zm16.76-7.7v4.62h3.35v3.16h-3.35v10.62c0 .73.14 1.25.43 1.57s.8.48 1.54.48c.5 0 1-.06 1.49-.18v3.31c-.97.27-1.9.4-2.81.4-3.27 0-4.91-1.81-4.91-5.43v-10.77h-3.12v-3.16h3.12v-4.63zm11.14 23.64h-4.26v-27h4.26zm9.17 0h-4.26v-19.02h4.26zm-4.52-23.96c0-.65.21-1.2.62-1.63.42-.43 1.01-.65 1.78-.65s1.37.22 1.79.65.63.98.63 1.64c0 .64-.21 1.18-.63 1.61s-1.02.64-1.79.64-1.36-.21-1.78-.64c-.41-.44-.62-.98-.62-1.62zm10.66 23.96v-15.86h-2.89v-3.16h2.89v-1.74c0-2.11.58-3.74 1.75-4.89s2.81-1.72 4.91-1.72c.75 0 1.54.11 2.39.32l-.1 3.34c-.54-.1-1.08-.15-1.63-.14-2.04 0-3.05 1.05-3.05 3.15v1.69h3.86v3.16h-3.86v15.85zm17.87-6.12 3.86-12.9h4.54l-7.54 21.9c-1.16 3.2-3.12 4.8-5.89 4.8-.62 0-1.3-.11-2.05-.32v-3.31l.81.05c1.07 0 1.88-.2 2.43-.59.54-.39.97-1.05 1.29-1.98l.61-1.64-6.66-18.93h4.6z"
- fill-rule="evenodd"></path><path
- d="m27.89 14.14-.01-.01c-.01 0-.02-.01-.02-.01-.02-.02-.03-.06-.03-.09l.77-4.73 3.62 3.63-3.77 1.6c-.01 0-.02.01-.03.01h-.02s-.01-.01-.02-.02c-.14-.16-.31-.29-.49-.38zm5.26-.29 3.88 3.88c.81.81 1.21 1.21 1.35 1.67.02.07.04.14.05.21l-9.26-3.92s-.01 0-.01-.01c-.04-.02-.08-.03-.08-.07s.04-.06.08-.07l.01-.01zm5.12 7c-.2.38-.59.77-1.25 1.43l-4.37 4.37-5.65-1.18-.03-.01c-.05-.01-.1-.02-.1-.06-.04-.47-.28-.9-.66-1.19-.02-.02-.02-.06-.01-.09v-.01l1.06-6.53v-.02c.01-.05.01-.11.06-.11.46-.06.88-.3 1.16-.67.01-.01.01-.02.03-.03.03-.01.07 0 .1.01zm-6.62 6.8-7.19 7.19 1.23-7.56v-.01c0-.01 0-.02.01-.03.01-.02.04-.03.06-.04h.01c.27-.11.51-.29.69-.52.02-.03.05-.06.09-.06h.03zm-8.71 8.71-.81.81-8.95-12.94s-.01-.01-.01-.01c-.01-.02-.03-.04-.03-.06s.01-.03.02-.04l.01-.01c.03-.04.05-.08.07-.12l.02-.03c.01-.02.03-.05.05-.06s.05-.01.07 0l9.92 2.05c.03 0 .05.02.08.03.01.01.02.03.02.04.14.53.52.97 1.03 1.17.03.01.02.05 0 .08-.01.01-.01.03-.01.05-.12.74-1.19 7.27-1.48 9.04zm-1.69 1.69c-.6.59-.95.9-1.35 1.03-.39.12-.81.12-1.21 0-.47-.15-.87-.55-1.67-1.36l-8.99-8.99 2.35-3.64c.01-.02.02-.03.04-.05s.06-.01.09 0c.54.16 1.12.13 1.64-.08.03-.01.05-.02.07 0l.03.03zm-14.09-10.19-2.06-2.06 4.07-1.74c.01 0 .02-.01.03-.01.03 0 .05.03.07.07.04.06.08.12.13.18l.01.02c.01.02 0 .03-.01.05zm-2.98-2.97-2.61-2.61c-.44-.44-.77-.77-.99-1.04l7.94 1.65h.03c.05.01.1.02.1.06 0 .05-.06.07-.11.09l-.02.01zm-4.05-5c.01-.17.04-.33.09-.5.15-.47.55-.87 1.36-1.67l3.34-3.34c1.54 2.23 3.08 4.46 4.63 6.69.03.04.06.08.03.11-.15.16-.29.34-.4.53-.01.02-.03.05-.05.06-.01.01-.03 0-.04 0zm5.68-6.4 4.49-4.49c.42.19 1.96.83 3.33 1.41 1.04.44 1.99.84 2.29.97.03.01.06.02.07.05.01.02 0 .04 0 .06-.14.66.05 1.35.52 1.83.03.03 0 .07-.03.11l-.01.02-4.56 7.06c-.01.02-.02.04-.04.05s-.06.01-.09 0c-.18-.05-.36-.07-.54-.07-.16 0-.34.03-.52.06-.02 0-.04.01-.05 0-.02-.01-.03-.03-.05-.05zm5.4-5.4 5.81-5.81c.81-.81 1.21-1.21 1.67-1.36.39-.12.81-.12 1.21 0 .47.15.87.55 1.67 1.36l1.26 1.26-4.14 6.4c-.01.02-.02.03-.04.05s-.06.01-.09 0c-.66-.2-1.38-.06-1.92.37-.03.03-.07.01-.1 0-.53-.24-4.73-2.01-5.33-2.27zm12.5-3.67 3.82 3.82-.92 5.7v.02c0 .01 0 .03-.01.04-.01.02-.03.02-.05.03-.2.06-.38.15-.55.27-.01.01-.01.01-.02.02s-.02.02-.04.02c-.01 0-.03 0-.04-.01l-5.82-2.47-.01-.01c-.04-.02-.08-.03-.08-.07-.03-.32-.14-.64-.31-.91-.03-.05-.06-.09-.03-.14zm-3.93 8.6 5.45 2.31c.03.01.06.03.08.06.01.02.01.04 0 .06-.02.08-.03.17-.03.26v.15c0 .04-.04.05-.08.07h-.01c-.86.37-12.13 5.17-12.15 5.17s-.03 0-.05-.02c-.03-.03 0-.07.03-.11 0-.01.01-.01.01-.02l4.48-6.94.01-.01c.03-.04.06-.09.1-.09l.05.01c.1.01.19.03.28.03.68 0 1.31-.33 1.69-.9.01-.02.02-.03.03-.04.04-.01.08 0 .11.01zm-6.25 9.19 12.28-5.24s.02 0 .03.02c.07.07.12.11.18.15l.03.02c.02.01.05.03.05.06v.02l-1.05 6.46v.03c-.01.05-.01.11-.06.11-.57.04-1.08.36-1.37.85v.01c-.01.02-.03.05-.05.06s-.05.01-.07 0l-9.79-2.02c-.02-.02-.16-.53-.18-.53z"
- fill="url(#netlify-gradient)"></path></svg
- >
- </a>
- </div>
- </div>
- </li>
- {sidebarSections.map((section) => (
- <li>
- <div class="nav-group">
- <h2 class="nav-group-title">{section.text}</h2>
- <ul>
- {section.children.map((child) => (
- <li class="nav-link">
- <a
- href={`${Astro.site.pathname}${child.link}`}
- aria-current={`${
- currentPageMatch === child.link ? 'page' : 'false'
- }`}
- >
- {child.text}
- </a>
- </li>
- ))}
- </ul>
- </div>
- </li>
- ))}
- </ul>
-</nav>
-
-<script>
- window.addEventListener('DOMContentLoaded', (event) => {
- var target = document.querySelector('[aria-current="page"]');
- if (target && target.offsetTop > window.innerHeight - 100) {
- document.querySelector('.nav-groups').scrollTop = target.offsetTop;
- }
- });
-</script>
-
-<style lang="scss">
- nav {
- width: 100%;
- margin-right: 1rem;
- }
- .nav-groups {
- height: 100%;
- padding: 2rem 0;
- overflow-x: visible;
- overflow-y: auto;
- max-height: 100vh;
-
- > li + li {
- margin-top: 1.75rem;
- }
-
- > :first-child {
- padding-top: var(--doc-padding);
- }
-
- > :last-child {
- padding-bottom: 2rem;
- margin-bottom: var(--theme-navbar-height);
- }
-
- @media (min-width: 50em) {
- padding: 0;
- }
- }
-
- .nav-group-title {
- font-size: 1rem;
- font-weight: 700;
- padding: 0.1rem 1rem;
- text-transform: uppercase;
- margin-bottom: 0.5rem;
- }
-
- .nav-link a {
- font-size: 1rem;
- margin: 1px;
- padding: 0.3rem 1rem;
- font: inherit;
- color: inherit;
- text-decoration: none;
- display: block;
-
- &:hover,
- &:focus {
- background-color: var(--theme-bg-hover);
- }
-
- &[aria-current='page'] {
- color: var(--theme-text-accent);
- background-color: var(--theme-bg-accent);
- font-weight: 600;
- }
- }
-
- :global(:root.theme-dark) .nav-link a[aria-current='page'] {
- color: hsla(var(--color-base-white), 100%, 1);
- }
-
- .sponsors {
- display: grid;
- padding-left: 1rem;
- padding-top: 0.25rem;
- margin-bottom: -0.375rem; // logo overshoot creates extra perceived space
- grid-gap: 0.5rem;
- grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
-
- svg {
- color: var(--theme-text);
- fill: currentColor;
- }
- }
-
- .sponsor-logo__netlify {
- width: 90px;
- }
-
- .sponsor-logo__vercel {
- width: 90px;
- }
- :global(:root.theme-dark .sponsors-title) {
- color: hsl(var(--color-base-gray), 75%);
- }
- .sponsors-title {
- color: hsl(var(--color-base-gray), 25%);
- font-size: 0.8em;
- font-weight: 300;
- letter-spacing: 0.0625em;
- margin: 0 0 0.5rem;
- padding-left: 1rem;
- text-transform: uppercase;
- }
-</style>