Switch from layout to slug & SSG routes

This commit is contained in:
2023-11-25 15:26:58 -06:00
parent a5db301e81
commit 2611f6ab2c
9 changed files with 24 additions and 17 deletions

View File

@@ -1,7 +1,6 @@
---
title: "Jekyll, GitHub Pages, and Azabani"
pubDate: 2020-12-04 13:16:22 -0600
layout: "@layouts/Post.astro"
tags: ["jekyll", "github-pages"]
description: "This is my first time trying to create a proper blog, and my second time using GitHub pages. How did it turn out?"
---

View File

@@ -1,5 +1,4 @@
---
layout: "@layouts/Post.astro"
title: "Painting Images with IPv6"
pubDate: 2023-04-14 13:07:43 -0500
tags: ["ipv6", "python", "asyncio", "websocket", "PIL"]

View File

@@ -1,6 +1,5 @@
---
title: "Project Facelift, New and Old"
layout: "@layouts/Post.astro"
pubDate: 2021-02-25 16:41:41 -0600
tags: ["projects", "photography", "update"]
preview_image: "https://raw.githubusercontent.com/Xevion/Paths/master/.media/banner.png"

View File

@@ -2,7 +2,6 @@
title: "Race Conditions in Signal Handlers"
pubDate: 2023-07-26 16:08:12 -0500
description: "Signals offer a unique, low-level way of communicating with processes. But under certain circumstances, they can kill processes, even when they shouldn't."
layout: "@layouts/Post.astro"
tags: ["tar", "signals", "interrupt", "handler", "process", "unix", "race-condition"]
---

View File

@@ -1,6 +1,5 @@
---
title: "Restricted Memory & Data Framing Tricks"
layout: "@layouts/Post.astro"
pubDate: 2022-07-16 13:51:00 -0500
tags: ["c", "memory", "embedded", "ti", "msp430", "union"]
description: "Tips and tricks I learned about handling restricted memory while working on microcontrollers at my first internship"

View File

@@ -1,5 +1,4 @@
---
layout: "@layouts/Post.astro"
title: "Runnerspace, Built in Under 30 Hours"
pubDate: 2022-03-29 13:56:22 -0600
tags: ["flask", "hackathon", "utsa", "rowdyhacks", "projects"]

View File

@@ -1,28 +1,24 @@
---
import Base from "@layouts/Base.astro";
import { type CollectionEntry } from 'astro:content';
interface Props {
title: string;
url: string;
description: string;
pubDate: string;
post: CollectionEntry<'blog'>;
}
const { frontmatter } = Astro.props;
const { title, url, pubDate, tags } = frontmatter;
const { post } = Astro.props;
const { title, pubDate, tags } = post.data;
---
<Base title={title}>
<div class="body-container">
<h1>
<a href={url}>
<a href={post.slug}>
{title}
</a>
</h1>
<p>
<i>
<a href={url}>
<a href={post.slug}>
<time datetime="{{ page.date | date: '%Y-%m-%dT%H:%M:%SZ' }}">
{pubDate}
</time>

View File

@@ -9,7 +9,7 @@ const posts = await getCollection("blog");
{
posts.map((post) => (
<Summary
url={post.slug}
url={`/posts/${post.slug}`}
description={post.data.description}
date={new Date()}
title={post.data.title}

View File

@@ -0,0 +1,17 @@
---
import Post from '@layouts/Post.astro';
import { getCollection, type CollectionEntry } from 'astro:content';
export async function getStaticPaths() {
const blogEntries = await getCollection('blog');
return blogEntries.map(entry => ({
params: { slug: entry.slug }, props: { entry },
}));
}
const { entry } = Astro.props;
const { Content } = await entry.render();
---
<Post post={entry}>
<Content />
</Post>