chchchchch changez

This commit is contained in:
Laker Turner 2025-03-30 21:12:05 +01:00
parent 2232741e04
commit f0b541cfdc
No known key found for this signature in database
24 changed files with 175 additions and 129 deletions

View file

@ -4,10 +4,10 @@ import BlogPostList from "~/components/lists/BlogPostList.astro";
---
<Page
title="Post index"
title="Blog thing yes yes"
description="A list of all my blog posts."
icon="fa-solid fa-blog"
icon="fa-solid fa-star"
>
<p class="mb-6">my personal blog is <a class="link" href="https://concorde.blog">Concorde</a>, but here has more technical things.</p>
<BlogPostList collection="blog" />
</Page>

View file

@ -0,0 +1,44 @@
---
import { getCollection } from "astro:content";
import Page from "~/layouts/Page.astro"
import Date from "~/components/util/Date.astro";
import StyledLink from "~/components/util/StyledLink.astro";
export async function getStaticPaths() {
const allPosts = await getCollection("blog");
const uniqueTags = [
...new Set(allPosts.map((post) => post.data.tags).flat()),
];
return uniqueTags.map((tag) => {
const filteredPosts = allPosts.filter((post) =>
post.data.tags.includes(tag)
);
return {
params: { tag },
props: { posts: filteredPosts },
};
});
}
const { tag } = Astro.params;
const { posts } = Astro.props;
---
<Page title={`Posts tagged with #${tag}`} icon="fa-solid fa-tag">
<StyledLink href="/blog/tags" icon="fa-solid fa-arrow-left">
See some more tags....
</StyledLink>
<ul class="fa-ul">
{
posts.map((post) => (
<li>
<i class={`fa-li ${post.data.icon} text-light-pu dark:text-dark-pu`}></i>
<a href={`/blog/${post.id}`}>{post.data.title}</a>
<span class="text-sm text-light-tx-2 dark:text-dark-tx-2">
(<Date date={post.data.date} />)
</span>
</li>
))
}
</ul>
</Page>

View file

@ -6,12 +6,15 @@ const allPosts = await getCollection("blog");
const tags = [...new Set(allPosts.map((post) => post.data.tags).flat())];
---
<Layout title="Tags" description="">
<Layout title="Tags" description="all the tags i've used, and probably some spelling mistakes" icon="fa-solid fa-tags">
<ul class="fa-ul">
{
tags.map((tag) => <li>
<i class="fa-li fa-solid fa-hashtag"></i>
<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">
({allPosts.filter((post) => post.data.tags.includes(tag)).length})
</span>
</li>)
}
</ul>

View file

@ -26,7 +26,7 @@ import Prose from "~/components/ui/Prose.astro";
<div class="md:flex md:flex-column gap-6">
<Box title="latest blog posts" icon="fa-solid fa-blog">
<CollectionList collection="blog" limit={5} />
<CollectionList limit={5} />
<hr class="h-px my-8 bg-light-pu dark:bg-dark-pu" />
<StyledLink href="/blog">see more</StyledLink>
</Box>

View file

@ -1,5 +1,5 @@
---
import { getCollection } from "astro:content";
import { getCollection, render } from "astro:content";
import Page from "~/layouts/Page.astro";
// import { Content } from "~/content/now.md";
import Prose from "~/components/ui/Prose.astro";
@ -14,23 +14,17 @@ async function getLatestNowPost() {
}
const latestPost = await getLatestNowPost(); // Fetch the first post at build time
const { Content } = await render(latestPost);
---
<Page title="/now" icon="fa-solid fa-calendar-days" date="2025-03-17">
<Page title="/now" description="" icon="fa-solid fa-calendar-days" date={latestPost.data.date}>
<Prose>
{latestPost ? <Content /> : <p>nae now</p>}
</Prose>
<p class="text-light-tx-2 dark:text-dark-tx-2 mt-2">
This is a <a href="https://sive.rs/nowff">/now page</a> and
<a href="https://nownownow.com/about">you should make one</a>, too.
<a href="https://nownownow.com/about">you should make one</a>, too. <br>
It's generated from the latest post tagged with <a href="/blog/tags/now">#now</a>, which currently is <a href={`/blog/${latestPost.id}`}>{latestPost.data.title}</a>.
</p>
<Prose>
{
latestPost ? (
<div>
<h2>{latestPost.data.title}</h2>
<p>{latestPost.data.description}</p>
</div>
) : (
<p>nae now</p>
)
}
</Prose>
</Page>