From 338bcf12e0b7bbd6e587ec992e62860642856e80 Mon Sep 17 00:00:00 2001 From: "houston[bot]" Date: Sat, 22 Jul 2023 12:57:20 -0700 Subject: Initial commit from Astro --- src/components/BaseHead.astro | 43 ++++++++++++++++++++++++++++++++++++++ src/components/Footer.astro | 13 ++++++++++++ src/components/FormattedDate.astro | 17 +++++++++++++++ src/components/Header.astro | 25 ++++++++++++++++++++++ src/components/HeaderLink.astro | 24 +++++++++++++++++++++ 5 files changed, 122 insertions(+) create mode 100644 src/components/BaseHead.astro create mode 100644 src/components/Footer.astro create mode 100644 src/components/FormattedDate.astro create mode 100644 src/components/Header.astro create mode 100644 src/components/HeaderLink.astro (limited to 'src/components') diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro new file mode 100644 index 0000000..e11d111 --- /dev/null +++ b/src/components/BaseHead.astro @@ -0,0 +1,43 @@ +--- +// Import the global.css file here so that it is included on +// all pages through the use of the component. +import '../styles/global.css'; + +interface Props { + title: string; + description: string; + image?: string; +} + +const canonicalURL = new URL(Astro.url.pathname, Astro.site); + +const { title, description, image = '/placeholder-social.jpg' } = Astro.props; +--- + + + + + + + + + + + +{title} + + + + + + + + + + + + + + + + diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..08395a4 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,13 @@ +--- +const today = new Date(); +--- + +
+ © {today.getFullYear()} YOUR NAME HERE. All rights reserved. +
+ diff --git a/src/components/FormattedDate.astro b/src/components/FormattedDate.astro new file mode 100644 index 0000000..1bcce73 --- /dev/null +++ b/src/components/FormattedDate.astro @@ -0,0 +1,17 @@ +--- +interface Props { + date: Date; +} + +const { date } = Astro.props; +--- + + diff --git a/src/components/Header.astro b/src/components/Header.astro new file mode 100644 index 0000000..4d3da1f --- /dev/null +++ b/src/components/Header.astro @@ -0,0 +1,25 @@ +--- +import HeaderLink from './HeaderLink.astro'; +import { SITE_TITLE } from '../consts'; +--- + +
+

+ {SITE_TITLE} +

+ +
+ diff --git a/src/components/HeaderLink.astro b/src/components/HeaderLink.astro new file mode 100644 index 0000000..3dd439b --- /dev/null +++ b/src/components/HeaderLink.astro @@ -0,0 +1,24 @@ +--- +import type { HTMLAttributes } from 'astro/types'; + +type Props = HTMLAttributes<'a'>; + +const { href, class: className, ...props } = Astro.props; + +const { pathname } = Astro.url; +const isActive = href === pathname || href === pathname.replace(/\/$/, ''); +--- + + + + + -- cgit v1.2.3