Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/components/SdkExamples.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
import { getCollection } from 'astro:content';

interface Props {
content: string;
subfolder: string;
}

const { content } = Astro.props;
const { subfolder } = Astro.props;

const unorderedExamples = await getCollection(content);
const unorderedExamples = await getCollection('sdk-examples', ({ id }) =>
id.startsWith(subfolder + '/')
);
const orderedExamples = unorderedExamples.sort((a, b) => a.data.order - b.data.order);

---
Expand Down
8 changes: 1 addition & 7 deletions src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineCollection } from 'astro:content';
import { docsSchema } from '@astrojs/starlight/schema';
import { z } from 'astro:content';
import { ClientPackageSchema } from './schemas/client-package';
import {CodeExampleSchema} from "src/schemas/code-example.ts";
import { CodeExampleSchema } from "./schemas/code-example";

const docs = defineCollection({
schema: docsSchema({
Expand All @@ -18,13 +18,7 @@ const sdkExamples = defineCollection({
schema: CodeExampleSchema,
})

const tlsExamples = defineCollection({
type: 'content',
schema: CodeExampleSchema,
})

export const collections = {
docs,
'sdk-examples': sdkExamples,
'tls-examples': tlsExamples,
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ This mounts the CA certificate at `/ca-certs/service-ca.crt`, which you can refe

Below are complete examples showing how to configure TLS with OAuth 2.0 authentication in each supported language:

<SdkExamples content="tls-examples" />
<SdkExamples subfolder="tls" />
4 changes: 2 additions & 2 deletions src/content/docs/start-here/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ This results in that user having the access described by the role to that worksp

### Report and Check Examples

<SdkExamples content="sdk-examples" />
<SdkExamples subfolder="getting-started" />

## Next steps and roadmap

Expand All @@ -262,4 +262,4 @@ We're open to contributions! Check us out on GitHub at [project-kessel](https://
|-------------------------|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| **Schema Language** | Use multiple files and languages for schema, with overlap and duplicated information | Unify all these into a single schema language—no duplication or repeated information |
| **Configuration Method**| Edit schema and config via files | Configure everything at runtime via an API |
| **RBAC Management** | Use temporary scripts or the pre-Kessel RBAC v1 API | Use an RBAC management API (v2) to encapsulate access grants and workspace management |
| **RBAC Management** | Use temporary scripts or the pre-Kessel RBAC v1 API | Use an RBAC management API (v2) to encapsulate access grants and workspace management |
File renamed without changes.