From 4bd38a74615a22cd5a964cbd86fd19aae20a41d6 Mon Sep 17 00:00:00 2001 From: Nathan Arthur Date: Wed, 20 Mar 2024 15:21:44 -0400 Subject: [PATCH] id elements to hide on snap --- src/components/Shadowbox.astro | 4 +- src/components/Sidebar.astro | 6 ++- src/pages/[slug].astro | 72 ++++++++++++++++------------------ 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/components/Shadowbox.astro b/src/components/Shadowbox.astro index 3831fbd..88090d9 100644 --- a/src/components/Shadowbox.astro +++ b/src/components/Shadowbox.astro @@ -2,12 +2,14 @@ interface Props { padding?: number; class?: string | undefined; + id?: string | undefined; } -const { padding = 1, class: className } = Astro.props; +const { padding = 1, class: className, id } = Astro.props; ---
{ sha && ( - + {sha.slice(0, 7)} ) diff --git a/src/pages/[slug].astro b/src/pages/[slug].astro index f0ece14..715200f 100644 --- a/src/pages/[slug].astro +++ b/src/pages/[slug].astro @@ -1,5 +1,5 @@ --- -import type { InferGetStaticPropsType } from "astro"; +import type { InferGetStaticPropsType } from "astro"; import Tags from "../components/Tags.astro"; import getPosts from "../lib/getPosts"; import Shadowbox from "../components/Shadowbox.astro"; @@ -12,10 +12,10 @@ import Paginated from "../layouts/Paginated.astro"; export async function getStaticPaths() { const posts = await getPosts({ includeUnpublished: true, - sort: true + sort: true, }); - const published = (p: Post) => p.status === "publish" + const published = (p: Post) => p.status === "publish"; return posts.map((post: Post, i: number) => ({ params: { @@ -31,22 +31,9 @@ export async function getStaticPaths() { type Props = InferGetStaticPropsType; -const { - post, - newer, - older -} = Astro.props as Props; +const { post, newer, older } = Astro.props as Props; -const { - content, - title, - tags, - disqus_id, - excerpt, - image, - status, - slug, -} = post +const { content, title, tags, disqus_id, excerpt, image, status, slug } = post; const isDraft = status === "draft"; const className = isDraft ? "draft" : undefined; @@ -66,32 +53,39 @@ const { extracted, ...imageProps } = image || {}; url: `/${older.slug}`, }} > -
- - - {extracted ? undefined : } - - - +
+ + + {extracted ? undefined : } + + + - - {isDraft ?

Comments are disabled on DRAFT pages.

: } -
-
+ + { + isDraft ? ( +

Comments are disabled on DRAFT pages.

+ ) : ( + + ) + } +
+
- -