Content retrival on all pages

This commit is contained in:
Antoine Phan
2025-06-05 17:51:43 +01:00
committed by Antoine Phan
parent dec7e70c43
commit 7ead9f397c
8 changed files with 65 additions and 16 deletions

View File

@@ -5,6 +5,9 @@ const query = `*[_type == "homepage"].description[].children[].text`;
export const load = async () => {
return {
description: await getFromCMS(query)
description: await getFromCMS(query),
ohs: "",
pictures: "",
FAQs: "",
};
};

View File

@@ -1,6 +1,5 @@
import { getFromCMS } from 'utils/utils.js';
// needs to concat and format this text
const query = `*[_type == "members"]{
name,
email,

View File

@@ -1,6 +1,7 @@
<script>
import CouncilCard from 'components/CouncilCard.svelte';
import Section from 'components/Section.svelte';
// import CouncilMember from 'utils/schemas.ts';
let { data } = $props();
</script>
@@ -9,6 +10,7 @@
<p class="page-title">Meet the council!</p>
<p>Group picture!</p>
<div class="flex flex-row flex-wrap items-center align-middle gap-10 p-4">
{#each data.members as councilMember}
<CouncilCard
@@ -21,13 +23,4 @@
></CouncilCard>
{/each}
</div>
<p>Here are the members of the ECSESS council!</p>
<div>
<h2>President</h2>
<p>Name:</p>
<p>Email:</p>
<p>Year:</p>
<p>Program:</p>
</div>
</Section>

View File

@@ -0,0 +1,17 @@
import { getFromCMS } from 'utils/utils.js';
// needs to concat and format this text
const query = `*[_type == "events"]{
name,
category,
date,
location,
description,
"lastUpdated": _updatedAt,
}`;
export const load = async () => {
return {
events: await getFromCMS(query)
};
};

View File

@@ -1,9 +1,19 @@
<script>
import Section from "components/Section.svelte";
let {data} = $props();
</script>
<title> ECSESS Events </title>
<Section>
<p class='page-title'>Events</p>
{#each data.events as event}
<div class="p-4 border-4 rounded-lg">
<p>{event.name}</p>
<p>{event.date}</p>
<p>{event.location}</p>
<p>{event.description}</p>
</div>
{/each}
</Section>

View File

@@ -0,0 +1,15 @@
import { getFromCMS } from 'utils/utils.js';
// needs to concat and format this text
const query = `*[_type == "resources"]{
title,
url,
description,
"lastUpdated":_updatedAt
}`;
export const load = async () => {
return {
resources: await getFromCMS(query)
};
};

View File

@@ -1,15 +1,19 @@
<script>
import Section from 'components/Section.svelte';
let { data } = $props();
</script>
<title> Resources </title>
<Section>
<p class='page-title'> Resources </p>
<h1>Resources for ECSE students at McGill University, presented by ECSESS!</h1>
<p class="page-title">Resources</p>
<h2>Technical</h2>
<h1>Resources for ECSE students at McGill University, presented by ECSESS!</h1>
<h2>Academic</h2>
{#each data.resources as re}
{re.title} <br>
{re.url} <br>
{re.description} <br>
<p>==============</p>
{/each}
</Section>

8
src/utils/schemas.ts Normal file
View File

@@ -0,0 +1,8 @@
type CouncilMember = {
name: string,
email: string,
position: string,
positionDescription: string,
image: string, // URL
yearProgram: string
}