Skip to content

Commit 925118f

Browse files
Merge pull request #8 from localstack/aws-service-docs
add aws service cards
2 parents 321254c + e934a99 commit 925118f

File tree

5 files changed

+116
-12
lines changed

5 files changed

+116
-12
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 { ServiceBox } from './ServiceBox.tsx';
4+
5+
const allServices = await getCollection('docs', ({ id }) => {
6+
return id.startsWith('aws/services/') && !id.includes('/index');
7+
});
8+
9+
const sortedServices = allServices.sort((a, b) => {
10+
const titleA = a.data.title || a.data.linkTitle || '';
11+
const titleB = b.data.title || b.data.linkTitle || '';
12+
return titleA.localeCompare(titleB);
13+
});
14+
15+
const serviceData = sortedServices.map(service => {
16+
const title = service.data.title || service.data.linkTitle || 'Unknown Service';
17+
const description = service.data.description || `Implementation details for ${title} API`;
18+
19+
const href = `/${service.id}`;
20+
21+
return {
22+
title,
23+
description,
24+
href
25+
};
26+
});
27+
---
28+
29+
<div class="service-grid">
30+
{serviceData.map(service => (
31+
<ServiceBox
32+
title={service.title}
33+
description={service.description}
34+
href={service.href}
35+
client:load
36+
/>
37+
))}
38+
</div>

src/components/ServiceBox.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
3+
interface ServiceBoxProps {
4+
title: string;
5+
description: string;
6+
href: string;
7+
}
8+
9+
export const ServiceBox: React.FC<ServiceBoxProps> = ({ title, description, href }) => {
10+
return (
11+
<a href={href} className="service-box">
12+
<div className="service-box-content">
13+
<h3 className="service-box-title">{title}</h3>
14+
<p className="service-box-description">{description}</p>
15+
</div>
16+
</a>
17+
);
18+
};

src/content/docs/aws/aws-services.md

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Local AWS Services
3+
description: Browse LocalStack's implemented AWS services and explore their capabilities
4+
template: doc
5+
sidebar:
6+
order: 3
7+
---
8+
9+
import DynamicAwsServices from '../../../components/DynamicAwsServices.astro';
10+
11+
Browse LocalStack's implemented AWS services and explore their comprehensive feature sets. Each service provides detailed documentation on APIs, configuration options, and practical examples to help you get started quickly.
12+
13+
<DynamicAwsServices />

src/styles/global.css

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,50 @@
22

33
@import '@astrojs/starlight-tailwind';
44
@import 'tailwindcss/theme.css' layer(theme);
5-
@import 'tailwindcss/utilities.css' layer(utilities);
5+
@import 'tailwindcss/utilities.css' layer(utilities);
6+
7+
.service-box {
8+
display: block;
9+
padding: 1.5rem;
10+
border: 1px solid var(--sl-color-gray-5);
11+
border-radius: 0.5rem;
12+
text-decoration: none;
13+
color: inherit;
14+
transition: all 0.2s ease;
15+
height: 100%;
16+
}
17+
18+
.service-box:hover {
19+
border-color: var(--sl-color-accent);
20+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
21+
transform: translateY(-2px);
22+
}
23+
24+
.service-box-content {
25+
height: 100%;
26+
display: flex;
27+
flex-direction: column;
28+
}
29+
30+
.service-box-title {
31+
font-size: 1.125rem;
32+
font-weight: 600;
33+
margin: 0 0 0.5rem 0;
34+
color: var(--sl-color-white);
35+
line-height: 1.4;
36+
}
37+
38+
.service-box-description {
39+
font-size: 0.875rem;
40+
color: var(--sl-color-gray-2);
41+
margin: 0;
42+
line-height: 1.5;
43+
flex-grow: 1;
44+
}
45+
46+
.service-grid {
47+
display: grid;
48+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
49+
gap: 1rem;
50+
margin-top: 2rem;
51+
}

0 commit comments

Comments
 (0)