This commit is contained in:
Ivy Turner 2025-04-27 21:13:52 +01:00
parent 030aa87fc5
commit 3462bccc98
No known key found for this signature in database
8 changed files with 33 additions and 25 deletions

View file

@ -0,0 +1 @@
# ivy.rs

View file

@ -23,7 +23,7 @@ export default defineConfig({
experimental: {
contentIntellisense: true,
fonts: [{
provider: fontProviders.bunny(),
provider: fontProviders.google(),
name: "Inter",
cssVariable: "--fontapi-inter"
}]

View file

@ -5,23 +5,22 @@ const { date } = Astro.props;
const isOldPost = (date: Date) => {
// very much stolen from the wonderful Robb Knight (https://rknight.me)
return true;
const d = DateTime.fromISO(date.toISOString()).setZone("Europe/London");
return DateTime.now().diff(d, "years").years > 4;
return DateTime.now().diff(d, "years").years > -1;
};
---
{
() => {
if (isOldPost) {
if (isOldPost(date)) {
return (
<Notif
level={0}
heading="This post is over 4 years old"
heading="This post is over 4 years old!"
icon="fa-solid fa-hand-pointer"
xstyle="ml-2 my-4 p-4 w-fit"
xstyle="ml-1 mb-4"
>
a
It might have now-false information or not reflect my current views.
</Notif>
);
}

View file

@ -10,20 +10,22 @@ interface Props {
// level 0: info/note
// level 1: warning
// level 2: attn needed: oh fuck
// level 2: attn needed
// level 3: oh fuck
const { level, icon, heading, xstyle } = Astro.props;
---
<div
class={clsx(`text-black ${xstyle}`, {
"bg-light-ye dark:bg-dark-ye": level === 0,
"bg-light-or dark:bg-dark-or": level === 1,
"bg-light-re dark:bg-dark-re": level === 2,
class={clsx(`w-fit p-2 px-4 my-2 ${xstyle}`, {
"bg-light-ui dark:bg-dark-ui": level === 0,
"bg-light-ye dark:bg-dark-ye text-black": level === 1,
"bg-light-or dark:bg-dark-or text-black": level === 2,
"bg-light-re dark:bg-dark-re text-black": level === 3,
})}
>
<div class="flex items-center">
{icon && <i class={`${icon} text-xl mr-2`}></i>}
{icon && <i class={`${icon} font-bold text-xl mr-2`} />}
{heading && <h2 class="text-xl font-bold">{heading}</h2>}
</div>
<slot />

View file

@ -17,7 +17,7 @@ const { title, date, description } = Astro.props;
{
() => {
if (!isProd()) {
return <Notif level={0} xstyle="w-fit p-2 mb-2">dev mode, hang tight</Notif>;
return <Notif level={1} xstyle="w-fit p-2 mb-2">dev mode, hang tight</Notif>;
}
}
}

View file

@ -22,7 +22,7 @@ const { Content } = await render(post);
date={post.data.date}
icon={post.data.icon}
>
<AgeWarning />
<AgeWarning date={post.data.date} />
<Prose>
<Content />
</Prose>

View file

@ -1,6 +1,7 @@
---
import Page from "~/layouts/Page.astro";
import BlogPostList from "~/components/lists/BlogPostList.astro";
import StyledLink from "~/components/util/StyledLink.astro";
---
<Page
@ -8,5 +9,6 @@ import BlogPostList from "~/components/lists/BlogPostList.astro";
description="writing"
icon="fa-solid fa-signature"
>
<StyledLink href="/blog/tags">See all the tags</StyledLink>
<BlogPostList />
</Page>

View file

@ -1,15 +1,19 @@
---
import Layout from "~/layouts/Page.astro";
import StyledLink from "~/components/util/StyledLink.astro";
import { getCollection } from "astro:content";
const allPosts = await getCollection("blog");
const tags = [...new Set(allPosts.map((post) => post.data.tags).flat())];
---
<Layout title="Tags" description="all the tags i've used, and probably some spelling mistakes" icon="fa-solid fa-tags">
<StyledLink href="/blog" icon="fa-solid fa-arrow-left">Back to the blog index</StyledLink>
<ul class="fa-ul">
{
tags.map((tag) => <li>
tags.map((tag) => <li class="mb-1">
<i class="fa-li fa-solid fa-hashtag text-light-pu dark:text-dark-pu"></i>
<a href={`/blog/tags/${tag}`}>{tag}</a>
<span class="text-sm text-light-tx-2 dark:text-dark-tx-2">