diff options
author | 2023-01-18 08:43:58 -0500 | |
---|---|---|
committer | 2023-01-18 08:43:58 -0500 | |
commit | 7d72aeeae8c867af2ae6c018611e39c184f50619 (patch) | |
tree | 93015c571dc820db3e37e8eba93455014a048d7e /examples/docs/src/components/RightSidebar | |
parent | 006405d33c2b8eb1307cb84161659428e43efa51 (diff) | |
download | astro-7d72aeeae8c867af2ae6c018611e39c184f50619.tar.gz astro-7d72aeeae8c867af2ae6c018611e39c184f50619.tar.zst astro-7d72aeeae8c867af2ae6c018611e39c184f50619.zip |
Migrate blog and docs starters to content collections (#5858)
* docs: update README for `content/`
* chore: update env
* feat: update blog to use content collections
* chore: remove with-content starter
* fix: single quotes -> double
* feat: update docs starter to content collections
* refactor: config -> consts
* chore: import type
* edit: Astro will -> Use
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* chore: remove unused null check
* nit: spacing
* nit: `as Props` 1
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* nit: `as Props` 2
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* chore: consistent CONSTS usage
* chore: `type` imports at top
* chore: consistent quote usage on YAML
* chore: remove `as Props` from docs
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'examples/docs/src/components/RightSidebar')
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/docs/src/components/RightSidebar/MoreMenu.astro b/examples/docs/src/components/RightSidebar/MoreMenu.astro index 4adffaff4..5dbf89678 100644 --- a/examples/docs/src/components/RightSidebar/MoreMenu.astro +++ b/examples/docs/src/components/RightSidebar/MoreMenu.astro @@ -1,13 +1,13 @@ --- import ThemeToggleButton from './ThemeToggleButton'; -import * as CONFIG from '../../config'; +import { COMMUNITY_INVITE_URL } from '../../consts'; type Props = { editHref: string; }; -const { editHref } = Astro.props as Props; -const showMoreSection = CONFIG.COMMUNITY_INVITE_URL; +const { editHref } = Astro.props; +const showMoreSection = Boolean(COMMUNITY_INVITE_URL); --- {showMoreSection && <h2 class="heading">More</h2>} @@ -39,9 +39,9 @@ const showMoreSection = CONFIG.COMMUNITY_INVITE_URL; ) } { - CONFIG.COMMUNITY_INVITE_URL && ( + COMMUNITY_INVITE_URL && ( <li class={`header-link depth-2`}> - <a href={CONFIG.COMMUNITY_INVITE_URL} target="_blank"> + <a href={COMMUNITY_INVITE_URL} target="_blank"> <svg aria-hidden="true" focusable="false" diff --git a/examples/docs/src/components/RightSidebar/RightSidebar.astro b/examples/docs/src/components/RightSidebar/RightSidebar.astro index d45fbd494..2a7190e50 100644 --- a/examples/docs/src/components/RightSidebar/RightSidebar.astro +++ b/examples/docs/src/components/RightSidebar/RightSidebar.astro @@ -1,14 +1,14 @@ --- +import type { MarkdownHeading } from 'astro'; import TableOfContents from './TableOfContents'; import MoreMenu from './MoreMenu.astro'; -import type { MarkdownHeading } from 'astro'; type Props = { headings: MarkdownHeading[]; githubEditUrl: string; }; -const { headings, githubEditUrl } = Astro.props as Props; +const { headings, githubEditUrl } = Astro.props; --- <nav class="sidebar-nav" aria-labelledby="grid-right"> diff --git a/examples/docs/src/components/RightSidebar/TableOfContents.tsx b/examples/docs/src/components/RightSidebar/TableOfContents.tsx index 34b0ab732..962d64ec2 100644 --- a/examples/docs/src/components/RightSidebar/TableOfContents.tsx +++ b/examples/docs/src/components/RightSidebar/TableOfContents.tsx @@ -1,6 +1,6 @@ -import { unescape } from 'html-escaper'; import type { MarkdownHeading } from 'astro'; import type { FunctionalComponent } from 'preact'; +import { unescape } from 'html-escaper'; import { useState, useEffect, useRef } from 'preact/hooks'; type ItemOffsets = { |