From 1db44ec4133547e9cc2f351b56b1d59fafbc5002 Mon Sep 17 00:00:00 2001
From: seth
Date: Wed, 10 Apr 2024 07:32:28 -0400
Subject: factor out components
---
src/components/Footer.astro | 3 +++
src/components/Gifs.astro | 20 --------------------
src/components/Head.astro | 15 +++++++++++++++
src/components/Nav.astro | 22 ++++++++++++++++++++++
src/components/NavBar.astro | 20 --------------------
src/layouts/Base.astro | 27 ++++++---------------------
src/layouts/Index.astro | 19 +++++++++++++++++--
src/layouts/Page.astro | 4 +++-
8 files changed, 66 insertions(+), 64 deletions(-)
create mode 100644 src/components/Footer.astro
delete mode 100644 src/components/Gifs.astro
create mode 100644 src/components/Head.astro
create mode 100644 src/components/Nav.astro
delete mode 100644 src/components/NavBar.astro
(limited to 'src')
diff --git a/src/components/Footer.astro b/src/components/Footer.astro
new file mode 100644
index 0000000..9a8a667
--- /dev/null
+++ b/src/components/Footer.astro
@@ -0,0 +1,3 @@
+
diff --git a/src/components/Gifs.astro b/src/components/Gifs.astro
deleted file mode 100644
index b82230e..0000000
--- a/src/components/Gifs.astro
+++ /dev/null
@@ -1,20 +0,0 @@
----
-import Picture from "astro/components/Picture.astro";
-import gifs from "@assets/gifs";
----
-
-
- {
- gifs.map(({ image, alt }) => {
- const img =
;
-
- if (image.src.includes("steam")) {
- return
{img};
- } else if (image.src.includes("poweredbynix")) {
- return
{img};
- } else {
- return img;
- }
- })
- }
-
diff --git a/src/components/Head.astro b/src/components/Head.astro
new file mode 100644
index 0000000..b7cabaf
--- /dev/null
+++ b/src/components/Head.astro
@@ -0,0 +1,15 @@
+---
+import "@fontsource-variable/noto-sans";
+import "@fontsource/noto-sans-mono";
+
+import "@styles/main.css";
+
+const { title, description } = Astro.props;
+---
+
+
+ {title}
+
+
+
+
diff --git a/src/components/Nav.astro b/src/components/Nav.astro
new file mode 100644
index 0000000..98f47ce
--- /dev/null
+++ b/src/components/Nav.astro
@@ -0,0 +1,22 @@
+---
+interface NavLink {
+ name: string;
+ url: string;
+}
+
+const links: NavLink[] = [
+ { name: "home", url: "/" },
+ {
+ name: "github",
+ url: "https://github.com/getchoo",
+ },
+];
+---
+
+
diff --git a/src/components/NavBar.astro b/src/components/NavBar.astro
deleted file mode 100644
index b7c0216..0000000
--- a/src/components/NavBar.astro
+++ /dev/null
@@ -1,20 +0,0 @@
----
-interface NavLink {
- name: string;
- url: string;
-}
-
-const links: NavLink[] = [
- { name: "home", url: "/" },
- {
- name: "github",
- url: "https://github.com/getchoo",
- },
-];
----
-
-
- {links.map(({ name, url }) =>
{name})}
-
-
-
diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro
index 6ec66c5..c60347c 100644
--- a/src/layouts/Base.astro
+++ b/src/layouts/Base.astro
@@ -1,37 +1,22 @@
---
-import "@fontsource-variable/noto-sans";
-import "@fontsource/noto-sans-mono";
-
-import NavBar from "@components/NavBar.astro";
-import "@styles/main.css";
+import Footer from "@components/Footer.astro";
+import Head from "@components/Head.astro";
+import Nav from "@components/Nav.astro";
const { title, description } = Astro.props.frontmatter || Astro.props;
---
-
-
- {title}
-
-
-
-
-
+
getchoo's website 🚀
-
+
-
+
diff --git a/src/layouts/Index.astro b/src/layouts/Index.astro
index b8e1945..cd7be22 100644
--- a/src/layouts/Index.astro
+++ b/src/layouts/Index.astro
@@ -1,11 +1,26 @@
---
import Base from "@layouts/Base.astro";
-import Gifs from "@components/Gifs.astro";
+import Picture from "astro/components/Picture.astro";
+import gifs from "@assets/gifs";
const { title, description } = Astro.props.frontmatter;
---
-
+
+ {
+ gifs.map(({ image, alt }) => {
+ const img =
;
+
+ if (image.src.includes("steam")) {
+ return
{img};
+ } else if (image.src.includes("poweredbynix")) {
+ return
{img};
+ } else {
+ return img;
+ }
+ })
+ }
+
diff --git a/src/layouts/Page.astro b/src/layouts/Page.astro
index 72512e2..e740d36 100644
--- a/src/layouts/Page.astro
+++ b/src/layouts/Page.astro
@@ -4,5 +4,7 @@ const { title, description } = Astro.props.frontmatter || Astro.props;
---
-
+
+
+
--
cgit v1.2.3