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 () => {
|
export const load = async () => {
|
||||||
return {
|
return {
|
||||||
description: await getFromCMS(query)
|
description: await getFromCMS(query),
|
||||||
|
ohs: "",
|
||||||
|
pictures: "",
|
||||||
|
FAQs: "",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { getFromCMS } from 'utils/utils.js';
|
import { getFromCMS } from 'utils/utils.js';
|
||||||
|
|
||||||
// needs to concat and format this text
|
|
||||||
const query = `*[_type == "members"]{
|
const query = `*[_type == "members"]{
|
||||||
name,
|
name,
|
||||||
email,
|
email,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import CouncilCard from 'components/CouncilCard.svelte';
|
import CouncilCard from 'components/CouncilCard.svelte';
|
||||||
import Section from 'components/Section.svelte';
|
import Section from 'components/Section.svelte';
|
||||||
|
// import CouncilMember from 'utils/schemas.ts';
|
||||||
let { data } = $props();
|
let { data } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@
|
|||||||
<p class="page-title">Meet the council!</p>
|
<p class="page-title">Meet the council!</p>
|
||||||
|
|
||||||
<p>Group picture!</p>
|
<p>Group picture!</p>
|
||||||
|
|
||||||
<div class="flex flex-row flex-wrap items-center align-middle gap-10 p-4">
|
<div class="flex flex-row flex-wrap items-center align-middle gap-10 p-4">
|
||||||
{#each data.members as councilMember}
|
{#each data.members as councilMember}
|
||||||
<CouncilCard
|
<CouncilCard
|
||||||
@@ -21,13 +23,4 @@
|
|||||||
></CouncilCard>
|
></CouncilCard>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</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>
|
</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>
|
<script>
|
||||||
import Section from "components/Section.svelte";
|
import Section from "components/Section.svelte";
|
||||||
|
let {data} = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<title> ECSESS Events </title>
|
<title> ECSESS Events </title>
|
||||||
|
|
||||||
<Section>
|
<Section>
|
||||||
<p class='page-title'>Events</p>
|
<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>
|
</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>
|
<script>
|
||||||
import Section from 'components/Section.svelte';
|
import Section from 'components/Section.svelte';
|
||||||
|
let { data } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<title> Resources </title>
|
<title> Resources </title>
|
||||||
|
|
||||||
<Section>
|
<Section>
|
||||||
<p class='page-title'> Resources </p>
|
<p class="page-title">Resources</p>
|
||||||
|
|
||||||
<h1>Resources for ECSE students at McGill University, presented by ECSESS!</h1>
|
<h1>Resources for ECSE students at McGill University, presented by ECSESS!</h1>
|
||||||
|
|
||||||
<h2>Technical</h2>
|
{#each data.resources as re}
|
||||||
|
{re.title} <br>
|
||||||
<h2>Academic</h2>
|
{re.url} <br>
|
||||||
|
{re.description} <br>
|
||||||
|
<p>==============</p>
|
||||||
|
{/each}
|
||||||
</Section>
|
</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