summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorseth <[email protected]>2023-05-16 03:53:24 -0400
committerseth <[email protected]>2023-05-16 04:08:37 -0400
commit681cd8c1cc2904c562f9a58db3cbb657d58fb552 (patch)
tree9255f71e577fc82f079c16ff493f432ca5557284 /src/components
parentbf4df962be338c08ae41bed94b1d60b2930fca9f (diff)
feat: rewrite with astro
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Head.astro11
-rw-r--r--src/components/Nav.astro29
-rw-r--r--src/components/PostList.astro15
3 files changed, 55 insertions, 0 deletions
diff --git a/src/components/Head.astro b/src/components/Head.astro
new file mode 100644
index 0000000..6f96984
--- /dev/null
+++ b/src/components/Head.astro
@@ -0,0 +1,11 @@
+---
+const { title, description } = Astro.props.title;
+---
+
+<head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <title>{title}</title>
+ <meta name="description" content={description} />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+</head>
diff --git a/src/components/Nav.astro b/src/components/Nav.astro
new file mode 100644
index 0000000..d25b180
--- /dev/null
+++ b/src/components/Nav.astro
@@ -0,0 +1,29 @@
+---
+const links = {
+ home: "/",
+ blog: "/blog",
+ github: "https://github.com/getchoo",
+};
+---
+
+<nav>
+ <div
+ class="flex flex-column align-center justify-center mx-auto p-5"
+ <ul
+ class="inline"
+ >
+ {
+ Object.entries(links).map(([link, url]) => (
+ <li class="inline text-base p-2">
+ <a href={url}>{link}</a>
+ </li>
+ ))
+ }
+ </div>
+</nav>
+
+<style>
+ a {
+ @apply rounded-xl bg-yellow p-2;
+ }
+</style>
diff --git a/src/components/PostList.astro b/src/components/PostList.astro
new file mode 100644
index 0000000..a537e43
--- /dev/null
+++ b/src/components/PostList.astro
@@ -0,0 +1,15 @@
+---
+const posts = await Astro.glob("../pages/blog/posts/*.md");
+---
+
+<div>
+ <ul class="postList">
+ {
+ posts.map((post) => (
+ <li>
+ <a href={post.url}>{post.frontmatter.title}</a>
+ </li>
+ ))
+ }
+ </ul>
+</div>