diff --git a/.astro/types.d.ts b/.astro/types.d.ts index 6ed10af..cc10e0a 100644 --- a/.astro/types.d.ts +++ b/.astro/types.d.ts @@ -277,91 +277,98 @@ declare module 'astro:content' { slug: "contributing"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "README.md": { id: "README.md"; slug: "readme"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/algorithms.md": { id: "lists/algorithms.md"; slug: "lists/algorithms"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/databases-and-filesystems.md": { id: "lists/databases-and-filesystems.md"; slug: "lists/databases-and-filesystems"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/essentials.md": { id: "lists/essentials.md"; slug: "lists/essentials"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/for-fun.md": { id: "lists/for-fun.md"; slug: "lists/for-fun"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/math.md": { id: "lists/math.md"; slug: "lists/math"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/need-sorting.md": { id: "lists/need-sorting.md"; slug: "lists/need-sorting"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/performance.md": { id: "lists/performance.md"; slug: "lists/performance"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/productivity.md": { id: "lists/productivity.md"; slug: "lists/productivity"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/programming-languages.md": { id: "lists/programming-languages.md"; slug: "lists/programming-languages"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> +} & { render(): Render[".md"] }; +"lists/stuff-to-do.md": { + id: "lists/stuff-to-do.md"; + slug: "lists/stuff-to-do"; + body: string; + collection: "resources"; + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/unix.md": { id: "lists/unix.md"; slug: "lists/unix"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; "lists/web-development.md": { id: "lists/web-development.md"; slug: "lists/web-development"; body: string; collection: "resources"; - data: any + data: InferEntrySchema<"resources"> } & { render(): Render[".md"] }; }; diff --git a/.github/workflows/update_submodules.yml b/.github/workflows/update_submodules.yml deleted file mode 100644 index b3c3c79..0000000 --- a/.github/workflows/update_submodules.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Update Submodules - -on: - schedule: - - cron: '0 0 */3 * *' # every 3 days at midnight - workflow_dispatch: - -jobs: - update: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - token: ${{ secrets.PAT }} - - - name: Update submodules - run: | - git config --global user.name 'GitHub Action' - git config --global user.email 'action@github.com' - git submodule update --remote --recursive - git add . - git diff --cached --quiet || git commit -m "action: update submodules" - git push diff --git a/src/content/_coord-hours.ts b/src/content/_coord-hours.ts index 16b2dc6..5b62b00 100644 --- a/src/content/_coord-hours.ts +++ b/src/content/_coord-hours.ts @@ -12,7 +12,7 @@ let CoordHours: CoordHour[] = [ }, { Time: "11 AM - 12 PM", - Coords: ["Pusti", "", "Sam", "", "Anna"], + Coords: ["Pusti", "Nico", "Sam", "Nico", "Anna"], }, { Time: "12 - 1 PM", @@ -20,11 +20,11 @@ let CoordHours: CoordHour[] = [ }, { Time: "1 - 2 PM", - Coords: ["Nico", "Emily", "Rahul", "Emily", "Michael"], + Coords: ["", "Emily", "Rahul", "Emily", "Michael"], }, { Time: "2 - 3 PM", - Coords: ["Nico", "", "", "", "Michael"], + Coords: ["", "", "", "", "Michael"], }, { Time: "3 - 4 PM", diff --git a/src/content/config.ts b/src/content/config.ts index b7875fc..288ed71 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -53,4 +53,12 @@ const coordinators = defineCollection({ ) }) -export const collections = { blog, events, coordinators }; +const resources = defineCollection({ + type: "content", + schema: z.object({ + title: z.string().optional(), + description: z.string().optional(), + }), +}); + +export const collections = { blog, events, resources, coordinators }; diff --git a/src/content/resources b/src/content/resources index c2cbd43..9e74fdc 160000 --- a/src/content/resources +++ b/src/content/resources @@ -1 +1 @@ -Subproject commit c2cbd434035ecc35a15c6c807f55c0942e651e18 +Subproject commit 9e74fdc836330d8e52eca055ac9d3175bf7f26e9 diff --git a/src/pages/lists/[...slug].astro b/src/pages/lists/[...slug].astro index a7d5d9c..ce6b51f 100644 --- a/src/pages/lists/[...slug].astro +++ b/src/pages/lists/[...slug].astro @@ -3,14 +3,16 @@ import { getCollection } from "astro:content"; import Layout from "../../layouts/Layout.astro"; export async function getStaticPaths() { - const resources = await getCollection("resources"); + const resources = await getCollection("resources"); - return resources.map((x) => ({ - params: { - slug: x.id.replace(/^lists\//, '').replace(/\.md$/, '') - }, - props: { entry: x }, - })); + return resources + .filter(resource => resource.id.startsWith('lists/')) + .map((x) => ({ + params: { + slug: x.id.replace(/^lists\//, '').replace(/\.md$/, '') + }, + props: { entry: x }, + })); } const { entry } = Astro.props; @@ -18,24 +20,53 @@ const { Content } = await entry.render(); --- -
-
-
- -
+
+
+
+ +
+
-
diff --git a/src/pages/resources.astro b/src/pages/resources.astro index c7a158b..7392fd8 100644 --- a/src/pages/resources.astro +++ b/src/pages/resources.astro @@ -4,15 +4,18 @@ import Layout from "../layouts/Layout.astro"; const resources = await getCollection("resources"); const readme = resources.find(d => d.id === "README.md"); +if (!readme) { + throw new Error("README.md not found in resources collection"); +} const { Content } = await readme.render(); --- -
-
-
- -
+
+
+
+ +
+
-