Content retrival on all pages
This commit is contained in:
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>
|
||||
|
||||
Reference in New Issue
Block a user