Skip to content

Commit 93a83ab

Browse files
committed
add more things
1 parent 230138c commit 93a83ab

File tree

11 files changed

+93
-30
lines changed

11 files changed

+93
-30
lines changed

src/components/SectionCards.astro

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ interface Props {
66
basePath: string;
77
title?: string;
88
customTitles?: Record<string, string>;
9+
useDirectFiles?: boolean;
910
}
1011
11-
const { basePath, title, customTitles = {} } = Astro.props;
12+
const { basePath, title, customTitles = {}, useDirectFiles = false } = Astro.props;
1213
13-
// Get only index files from immediate subdirectories
14+
// Get sections - either index files from subdirectories or direct files
1415
const allSections = await getCollection('docs', ({ id }) => {
1516
// Must start with the base path
1617
if (!id.startsWith(basePath)) {
@@ -23,25 +24,20 @@ const allSections = await getCollection('docs', ({ id }) => {
2324
// Split into parts and filter out empty strings
2425
const pathParts = relativePath.split('/').filter(part => part !== '');
2526
26-
// For index files, we should have exactly 1 part: [subdirectory]
27-
// because index files get the ID of their parent directory in Astro
28-
if (pathParts.length === 1) {
29-
const subdirectory = pathParts[0];
30-
31-
// These are the known subdirectories with index files
32-
const validSubdirectories = [
33-
'web-app',
34-
'config',
35-
'cloud-sandbox',
36-
'networking',
37-
'state-management',
38-
'chaos-engineering',
39-
'security-testing'
40-
];
41-
42-
43-
44-
return validSubdirectories.includes(subdirectory);
27+
if (useDirectFiles) {
28+
// For direct files, we should have exactly 1 part: [filename]
29+
// and it should not be an index file
30+
if (pathParts.length === 1) {
31+
const filename = pathParts[0];
32+
return !filename.startsWith('index');
33+
}
34+
} else {
35+
// For index files, we should have exactly 1 part: [subdirectory]
36+
// because index files get the ID of their parent directory in Astro
37+
if (pathParts.length === 1) {
38+
// Accept any single-level subdirectory - let the content collection handle validation
39+
return true;
40+
}
4541
}
4642
4743
return false;
@@ -54,12 +50,15 @@ const sortedSections = allSections.sort((a, b) => {
5450
});
5551
5652
const sectionData = sortedSections.map(section => {
57-
// Extract the subdirectory name from the section ID
53+
// Extract the key name from the section ID
5854
const relativePath = section.id.substring(basePath.length);
59-
const subdirectory = relativePath.split('/').filter(part => part !== '')[0];
55+
const keyName = relativePath.split('/').filter(part => part !== '')[0];
56+
57+
// For direct files, we need to remove the file extension from the key
58+
const cleanKey = useDirectFiles ? keyName.replace(/\.(md|mdx)$/, '') : keyName;
6059
6160
// Use custom title if provided, otherwise fall back to the section title
62-
const sectionTitle = customTitles[subdirectory] || section.data.title || section.data.linkTitle || 'Unknown Section';
61+
const sectionTitle = customTitles[cleanKey] || section.data.title || section.data.linkTitle || 'Unknown Section';
6362
const description = section.data.description || `Learn more about ${sectionTitle}`;
6463
6564
const href = `/${section.id}`;

src/content/docs/aws/enterprise/index.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ sidebar:
88

99
import SectionCards from '../../../../components/SectionCards.astro';
1010

11-
# LocalStack Enterprise
12-
1311
This section provides guides and resources to help you get started with LocalStack Enterprise.
1412

1513
<SectionCards
1614
basePath="aws/enterprise/"
15+
useDirectFiles={true}
1716
customTitles={{
1817
"enterprise-support": "Enterprise Support",
1918
"enterprise-image": "Enterprise Image",
2019
"k8s-operator": "Kubernetes Operator",
21-
"kubernetes-execution": "Kubernetes Executor",
20+
"kubernetes-executor": "Kubernetes Executor",
2221
"sso": "Single Sign-On",
2322
}}
24-
/>
23+
/>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Overview
3+
description: Use LocalStack with your application frameworks to develop and test your applications locally.
4+
template: doc
5+
sidebar:
6+
order: 1
7+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Overview
3+
description: Use LocalStack with AWS Native tools to develop, deploy, and manage your infrastructure locally.
4+
template: doc
5+
sidebar:
6+
order: 1
7+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Overview
3+
description: Use LocalStack with AWS SDKs to manage your AWS resources locally.
4+
template: doc
5+
sidebar:
6+
order: 1
7+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Overview
3+
description: Use LocalStack with container-based development tools to manage and test your infrastructure locally.
4+
template: doc
5+
sidebar:
6+
order: 1
7+
---

src/content/docs/aws/integrations/continuous-integration/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Overview
3-
description: Run LocalStack in your CI environment to test your application against a high-fidelity cloud emulator.
3+
description: Use LocalStack in your CI environment to run tests against your AWS infrastructure in a high-fidelity cloud emulator.
44
template: doc
55
sidebar:
66
order: 1

src/content/docs/aws/integrations/index.mdx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Use your favorite cloud development tools with LocalStack.
44
template: doc
55
---
66

7+
import SectionCards from '../../../../components/SectionCards.astro';
8+
79
LocalStack supports a wide range of tools from the cloud development ecosystem.
810
This section of the documentation covers tools that are officially supported by LocalStack.
911

@@ -21,4 +23,18 @@ We strive to make the integration of LocalStack into your workflow as seamless a
2123
Sometimes it's as easy as calling one of our wrapper tools, like `awslocal`, a drop-in replacement for the `aws` CLI.
2224
Other times there is a bit of configuration involved.
2325

24-
Here is a list of tools we support, and documentation on how to integrate LocalStack:
26+
Here is a list of tools we support, and documentation on how to integrate LocalStack.
27+
28+
<SectionCards
29+
basePath="aws/integrations/"
30+
customTitles={{
31+
"app-frameworks": "App Frameworks",
32+
"aws-native-tools": "AWS Native Tools",
33+
"aws-sdks": "AWS SDKs",
34+
"containers": "Containers",
35+
"continuous-integration": "Continuous Integration",
36+
"infrastructure-as-code": "Infrastructure as Code",
37+
"messaging": "Messaging",
38+
"testing": "Testing",
39+
}}
40+
/>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Overview
3+
description: Use LocalStack with Infrastructure as Code tools to validate your infrastructure deployments and run tests against them.
4+
template: doc
5+
sidebar:
6+
order: 1
7+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Overview
3+
description: Use LocalStack with messaging tools, such as Kafka, to test your messaging infrastructure locally.
4+
template: doc
5+
sidebar:
6+
order: 1
7+
---

0 commit comments

Comments
 (0)