mirror of
https://git.solarpunk.moe/Fries/fries-website.git
synced 2024-12-22 04:59:18 +00:00
Update website to use Astro 5.
This commit is contained in:
parent
77b4092fee
commit
08449415e4
10 changed files with 1435 additions and 1610 deletions
10
package.json
10
package.json
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2958
pnpm-lock.yaml
2958
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -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!">
|
||||||
|
|
|
@ -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.">
|
||||||
|
|
|
@ -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
26
src/content.config.ts
Normal 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,
|
||||||
|
};
|
|
@ -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
|
|
||||||
};
|
|
|
@ -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"
|
|
||||||
}
|
|
|
@ -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 |
Loading…
Reference in a new issue