Skip to content

Commit 12cee98

Browse files
committed
get the structure right
1 parent c909536 commit 12cee98

File tree

7 files changed

+1444
-10
lines changed

7 files changed

+1444
-10
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
import { getCollection } from 'astro:content';
3+
import { TutorialsShowcase } from './tutorials/TutorialsShowcase';
4+
5+
// Import data for filters
6+
import services from '../data/developerhub/services.json';
7+
import platforms from '../data/developerhub/platforms.json';
8+
import deployments from '../data/developerhub/deployments.json';
9+
10+
const allTutorials = await getCollection('docs', ({ id }) => {
11+
return id.startsWith('aws/tutorials/') && !id.includes('/index');
12+
});
13+
14+
const tutorialData = allTutorials.map(tutorial => {
15+
const title = tutorial.data.title || 'Unknown Tutorial';
16+
const description = tutorial.data.description || `Tutorial: ${title}`;
17+
const slug = tutorial.slug ? tutorial.slug.replace('aws/tutorials/', '') : '';
18+
19+
return {
20+
title,
21+
description,
22+
slug,
23+
leadimage: tutorial.data.leadimage,
24+
services: tutorial.data.services || [],
25+
platform: tutorial.data.platform || [],
26+
deployment: tutorial.data.deployment || [],
27+
pro: tutorial.data.pro || false,
28+
};
29+
});
30+
---
31+
32+
<TutorialsShowcase
33+
tutorials={tutorialData}
34+
services={services}
35+
platforms={platforms}
36+
deployments={deployments}
37+
client:load
38+
/>

0 commit comments

Comments
 (0)