fix: archive pages now actually work + misc stuff

This commit is contained in:
Kebo Kitanari 2024-11-14 13:46:20 -06:00
parent 15cfef5332
commit 5f8a34cbd3
4 changed files with 71 additions and 45 deletions

View file

@ -1,5 +1,9 @@
---
const p = Astro.props;
const hrClass = "flex-grow w-auto self-baseline h-1 border-t border-crusta-200 dark:border-night-800 m-4 " + p.class;
---
<div class="flex-grow w-auto self-baseline h-1 border-t border-crusta-200 dark:border-night-800 m-4"></div>
<div class={hrClass}></div>

View file

@ -0,0 +1,19 @@
---
export const prerender = true;
import {getCollection} from 'astro:content'
export async function getStaticPaths() {
const archives = await getCollection('archives');
return archives.map(p => ({
params: { slug: p.slug }, props: { p },
}));
}
const { p } = Astro.props;
const { Content } = await p.render();
---
<Content />

View file

@ -46,7 +46,7 @@ const archives = await getCollection('archives');
console.log(toZonedTime(post.data.date, timeZone));
return (
<li>
<a href={'/posts/' + post.slug} class="font-serif text-lg text-crusta-400 dark:text-night-300 hover:underline">{post.data.title}</a>
<a href={'/archives/' + post.slug} class="font-serif text-lg text-crusta-400 dark:text-night-300 hover:underline">{post.data.title}</a>
&emsp;<span class="font-mono text-md">{format(toZonedTime(post.data.date, timeZone), 'LLL d, yyyy')}</span>
<p>{post.data.summary}</p>
</li>

View file

@ -36,47 +36,50 @@
}
article > h1 {
article {
h1 {
@apply text-3xl font-serif font-bold text-title mb-3 mt-1
}
article > h2 {
h2 {
@apply text-2xl font-serif font-semibold text-title mb-2
}
article > h3 {
h3 {
@apply text-xl font-serif text-title mb-2
}
article > h4 {
h4 {
@apply text-lg font-serif italic text-title mb-2
}
article > p {
p {
@apply text-black dark:text-night-100 mb-2
}
article > p > a,
article > ul > li > a,
article > ol > li > a {
a,
p > a,
ul > li > a,
ol > li > a {
@apply font-serif text-subtitle text-sm hover:underline data-[level=two]:pl-2 data-[level=three]:pl-4
}
article > blockquote {
blockquote {
@apply p-4 border-s-4 text-muted-foreground bg-muted
}
article > pre {
pre {
@apply p-2 bg-neutral-300 bg-opacity-50 dark:bg-slate-800 dark:bg-opacity-100 rounded-lg font-mono overflow-y-scroll mb-2
}
article > p > code {
p > code {
@apply px-1 bg-neutral-300 bg-opacity-50 dark:bg-slate-600 dark:bg-opacity-100 rounded-md font-mono
}
article > pre > code {
pre > code {
@apply px-0 bg-transparent rounded-none
}
article > ul {
ul {
@apply p-2 pl-4 mb-2 list-disc text-black dark:text-night-100
}
article > ol {
ol {
@apply ml-2 p-2 pl-4 mb-2 list-decimal text-black dark:text-night-100
}
article > li {
li {
@apply mb-1
}
article > img {
img {
@apply relative -z-10 border-4 border-crusta-200 dark:border-night-800 rounded-lg shadow-lgr shadow-crusta-400/20 dark:shadow-night-400/50 my-2
}
}