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: { experimental: {
contentIntellisense: true, contentIntellisense: true,
fonts: [{ fonts: [{
provider: fontProviders.bunny(), provider: fontProviders.google(),
name: "Inter", name: "Inter",
cssVariable: "--fontapi-inter" cssVariable: "--fontapi-inter"
}] }]

View file

@ -5,23 +5,22 @@ const { date } = Astro.props;
const isOldPost = (date: Date) => { const isOldPost = (date: Date) => {
// very much stolen from the wonderful Robb Knight (https://rknight.me) // very much stolen from the wonderful Robb Knight (https://rknight.me)
return true;
const d = DateTime.fromISO(date.toISOString()).setZone("Europe/London"); 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 ( return (
<Notif <Notif
level={0} level={0}
heading="This post is over 4 years old" heading="This post is over 4 years old!"
icon="fa-solid fa-hand-pointer" 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> </Notif>
); );
} }

View file

@ -2,29 +2,31 @@
import { clsx } from "clsx"; import { clsx } from "clsx";
interface Props { interface Props {
level: number; level: number;
icon?: string; icon?: string;
heading?: string; heading?: string;
xstyle?: string; xstyle?: string;
} }
// level 0: info/note // level 0: info/note
// level 1: warning // level 1: warning
// level 2: attn needed: oh fuck // level 2: attn needed
// level 3: oh fuck
const { level, icon, heading, xstyle } = Astro.props; const { level, icon, heading, xstyle } = Astro.props;
--- ---
<div <div
class={clsx(`text-black ${xstyle}`, { class={clsx(`w-fit p-2 px-4 my-2 ${xstyle}`, {
"bg-light-ye dark:bg-dark-ye": level === 0, "bg-light-ui dark:bg-dark-ui": level === 0,
"bg-light-or dark:bg-dark-or": level === 1, "bg-light-ye dark:bg-dark-ye text-black": level === 1,
"bg-light-re dark:bg-dark-re": level === 2, "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"> <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>} {heading && <h2 class="text-xl font-bold">{heading}</h2>}
</div> </div>
<slot /> <slot />
</div> </div>

View file

@ -17,7 +17,7 @@ const { title, date, description } = Astro.props;
{ {
() => { () => {
if (!isProd()) { 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} date={post.data.date}
icon={post.data.icon} icon={post.data.icon}
> >
<AgeWarning /> <AgeWarning date={post.data.date} />
<Prose> <Prose>
<Content /> <Content />
</Prose> </Prose>

View file

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

View file

@ -1,15 +1,19 @@
--- ---
import Layout from "~/layouts/Page.astro"; import Layout from "~/layouts/Page.astro";
import StyledLink from "~/components/util/StyledLink.astro";
import { getCollection } from "astro:content"; import { getCollection } from "astro:content";
const allPosts = await getCollection("blog"); const allPosts = await getCollection("blog");
const tags = [...new Set(allPosts.map((post) => post.data.tags).flat())]; 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"> <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"> <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> <i class="fa-li fa-solid fa-hashtag text-light-pu dark:text-dark-pu"></i>
<a href={`/blog/tags/${tag}`}>{tag}</a> <a href={`/blog/tags/${tag}`}>{tag}</a>
<span class="text-sm text-light-tx-2 dark:text-dark-tx-2"> <span class="text-sm text-light-tx-2 dark:text-dark-tx-2">