Update website to use Astro 5.

This commit is contained in:
Fries 2024-12-10 23:50:26 -08:00
parent 77b4092fee
commit 08449415e4
10 changed files with 1435 additions and 1610 deletions

View file

@ -10,13 +10,13 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@fontsource/atkinson-hyperlegible": "^5.0.20", "@fontsource/atkinson-hyperlegible": "^5.1.0",
"astro": "^4.13.3" "astro": "^5.0.4"
}, },
"devDependencies": { "devDependencies": {
"@astrojs/check": "^0.7.0", "@astrojs/check": "^0.9.4",
"prettier": "~3.3.3", "prettier": "~3.3.3",
"sharp": "^0.33.4", "sharp": "^0.33.5",
"typescript": "^5.5.4" "typescript": "^5.7.2"
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,9 @@
--- ---
import { getEntry, render } from "astro:content";
import { getEntryBySlug } from "astro:content"; import { getEntryBySlug } from "astro:content";
const introduction = await getEntryBySlug("homepage", "introduction"); const introduction = await getEntry("homepage", "introduction");
const { Content } = await introduction.render(); const { Content } = await render(introduction);
--- ---
<section id="introduction" aria-label="introducing myself!"> <section id="introduction" aria-label="introducing myself!">

View file

@ -1,8 +1,9 @@
--- ---
import { getEntryBySlug } from "astro:content"; import { getEntry, render } from "astro:content";
const links = await getEntry("homepage", "links")
const { Content } = await render(links);
const links = await getEntryBySlug("homepage", "links")
const { Content } = await links.render();
--- ---
<section id="links" aria-label="links to my social media profiles."> <section id="links" aria-label="links to my social media profiles.">

View file

@ -1,7 +1,6 @@
--- ---
import { Image } from 'astro:assets'; import { Image } from 'astro:assets';
import allissaImage from "../website_buttons/itzzennet.png";
import emImage from "../website_buttons/easrng.gif"; import emImage from "../website_buttons/easrng.gif";
interface Props { interface Props {
@ -13,7 +12,6 @@ interface Props {
const { name, alt_text, website } = Astro.props; const { name, alt_text, website } = Astro.props;
const images: { [key: string]: ImageMetadata } = { const images: { [key: string]: ImageMetadata } = {
"allissa": allissaImage,
"em": emImage "em": emImage
}; };
--- ---

26
src/content.config.ts Normal file
View file

@ -0,0 +1,26 @@
import { z, defineCollection } from "astro:content";
import { friends_schema } from "./schema/friends_schema";
import { glob } from "astro/loaders";
const homepageCollection = defineCollection({
loader: glob({ pattern: "**/[^_]*.md", base: "./src/content/homepage" }),
});
const friendsCollection = defineCollection({
loader: glob({ pattern: "**/[^_]*.json", base: "./src/content/friends" }),
schema: friends_schema,
});
const projectsCollection = defineCollection({
loader: glob({ pattern: "**/[^_]*.md", base: "./src/content/projects" }),
schema: z.object({
title: z.string(),
description: z.string(),
}),
});
export const collections = {
homepage: homepageCollection,
friends: friendsCollection,
projects: projectsCollection,
};

View file

@ -1,21 +0,0 @@
import { z, defineCollection } from "astro:content";
import { friends_schema } from "../schema/friends_schema";
const homepageCollection = defineCollection({});
const friendsCollection = defineCollection({
type: 'data',
schema: friends_schema
});
const projectsCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string()
})
});
export const collections = {
'homepage': homepageCollection,
'friends': friendsCollection,
'projects': projectsCollection
};

View file

@ -1,10 +0,0 @@
{
"name": "allissa",
"website": "https://itzzen.net/",
"description": "the website girl! shes cute!",
"website_button": {
"name": "allissa",
"alt_text": "a black box that says \"allissa's comfy burrow, now!\", with the now at the top right corner."
},
"pronouns": "she/her"
}

View file

@ -1,16 +1,16 @@
--- ---
import Layout from "../../layouts/Layout.astro"; import Layout from "../../layouts/Layout.astro";
import { getCollection } from "astro:content"; import { getCollection, render } from "astro:content";
export async function getStaticPaths() { export async function getStaticPaths() {
const projects = await getCollection("projects"); const projects = await getCollection("projects");
return projects.map(project => ({ return projects.map(project => ({
params: {page: project.slug}, props: {project} params: {page: project.id}, props: {project}
})); }));
} }
const { project } = Astro.props; const { project } = Astro.props;
const { Content } = await project.render(); const { Content } = await render(project);
--- ---
<Layout title={project.data.title}> <Layout title={project.data.title}>
<article> <article>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB