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)
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user