summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorseth <[email protected]>2024-02-12 20:29:15 -0500
committerseth <[email protected]>2024-02-13 00:24:08 -0500
commit2cbc22348ef038181e1dc89635a3be005604a4ca (patch)
tree33a33ffe0203b730078d01c5d7d3951239619ca9 /src/components
parent05780c6b2d8b184122a32095c50363a6c8617d64 (diff)
back to astro
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Footer.astro30
-rw-r--r--src/components/Head.astro23
-rw-r--r--src/components/Nav.astro28
3 files changed, 81 insertions, 0 deletions
diff --git a/src/components/Footer.astro b/src/components/Footer.astro
new file mode 100644
index 0000000..4f7286f
--- /dev/null
+++ b/src/components/Footer.astro
@@ -0,0 +1,30 @@
+---
+import { execa } from "execa";
+import Picture from "astro/components/Picture.astro";
+import gifs from "@assets/gifs";
+
+const { stdout: gitCommit } = await execa("git", ["rev-parse", "HEAD"]);
+---
+
+<footer class="text-xs text-subtext1 my-10 text-right space-y-2">
+ <div class="hidden md:flex flex-wrap justify-around">
+ {
+ gifs.map(({ gif, alt }) => {
+ const img = <Picture src={gif} alt={alt} formats={["gif"]} />;
+
+ if (gif.src.includes("steam.gif")) {
+ return <a href="https://dnsense.pub/">{img}</a>;
+ } else if (gif.src.includes("poweredbynix.svg")) {
+ return <a href="https://github.com/sakecode">{img}</a>;
+ } else {
+ return img;
+ }
+ })
+ }
+ </div>
+ <p>
+ Served from commit {gitCommit.substring(0, 8)} (<a
+ href="https://github.com/getchoo/website">source</a
+ >)
+ </p>
+</footer>
diff --git a/src/components/Head.astro b/src/components/Head.astro
new file mode 100644
index 0000000..f2f7835
--- /dev/null
+++ b/src/components/Head.astro
@@ -0,0 +1,23 @@
+---
+import "@fontsource-variable/noto-sans";
+import "@fontsource/noto-sans-mono";
+const { title, description } = Astro.props;
+---
+
+<head>
+ <meta charset="UTF-8" />
+ <title>{title}</title>
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <meta name="description" content={description} />
+ <link rel="sitemap" href="/sitemap-index.xm" />
+</head>
+<style is:global>
+ a {
+ text-decoration: underline;
+ @apply text-blue;
+ }
+
+ h1 {
+ @apply text-3xl md:text-4xl;
+ }
+</style>
diff --git a/src/components/Nav.astro b/src/components/Nav.astro
new file mode 100644
index 0000000..c08662d
--- /dev/null
+++ b/src/components/Nav.astro
@@ -0,0 +1,28 @@
+---
+import config from "@root/astro.config.ts";
+
+interface NavLink {
+ name: string;
+ url: string;
+}
+
+const links: NavLink[] = [
+ { name: "home", url: "/" },
+ {
+ name: "miniflux",
+ url: `https://miniflux.${Astro.url.hostname || config.site}`,
+ },
+ {
+ name: "github",
+ url: "https://github.com/getchoo",
+ },
+];
+---
+
+<nav class="space-y-5 text-xl my-5">
+ <p>
+ {links.map(({ name, url }) => <a href={url}>{name}</a>)}
+ </p>
+
+ <hr />
+</nav>