diff options
Diffstat (limited to 'old_stuff/src/pages/blogs.astro')
| -rw-r--r-- | old_stuff/src/pages/blogs.astro | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/old_stuff/src/pages/blogs.astro b/old_stuff/src/pages/blogs.astro new file mode 100644 index 0000000..7e1b576 --- /dev/null +++ b/old_stuff/src/pages/blogs.astro @@ -0,0 +1,38 @@ +--- +import Terminal from "@layouts/Terminal.astro"; +import TerminalBorder from "@components/TerminalBorder.astro"; +import BlogItem from "@components/BlogItem.astro"; +import { getCollection } from "astro:content"; + +const blogs = (await getCollection("blogs")) + .sort((a, b) => +new Date(b.data.date) - +new Date(a.data.date)) + .map((blog) => ({ + title: blog.data.title, + description: blog.data.description, + date: blog.data.date, + href: "/blogs/" + blog.slug, + })); +--- + +<Terminal path="/home/kyren/blogs/"> + <TerminalBorder + header="Shell" + extra="mb-[5vw] sm:mt-[0.625vw] sm:mb-[1.5625vw]" + > + <p>$ ls -lah -t --color=auto ~/blogs</p> + </TerminalBorder> + <div class="max-h-[80svh] sm:max-h-[24vw] overflow-y-auto"> + { + blogs.map((blog) => ( + <> + <BlogItem + title={blog.title} + description={blog.description ?? ""} + date={blog.date} + href={blog.href} + /> + </> + )) + } + </div> +</Terminal> |
