Content retrival on all pages
This commit is contained in:
@@ -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: "",
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { getFromCMS } from 'utils/utils.js';
|
||||
|
||||
// needs to concat and format this text
|
||||
const query = `*[_type == "members"]{
|
||||
name,
|
||||
email,
|
||||
|
||||
@@ -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>
|
||||
|
||||
17
src/routes/events/+page.server.js
Normal file
17
src/routes/events/+page.server.js
Normal 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)
|
||||
};
|
||||
};
|
||||
@@ -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>
|
||||
|
||||
15
src/routes/resources/+page.server.js
Normal file
15
src/routes/resources/+page.server.js
Normal 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)
|
||||
};
|
||||
};
|
||||
@@ -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
8
src/utils/schemas.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
type CouncilMember = {
|
||||
name: string,
|
||||
email: string,
|
||||
position: string,
|
||||
positionDescription: string,
|
||||
image: string, // URL
|
||||
yearProgram: string
|
||||
}
|
||||
Reference in New Issue
Block a user