From 8e53d5fbba5a00aa0187e1dfcc0e6fae8dfe6956 Mon Sep 17 00:00:00 2001 From: Injae Ryou Date: Fri, 7 Nov 2025 06:38:59 +0000 Subject: [PATCH] Feat Enhance implementation collection to include 'both' subtype - Add 'subtype' field in the implementation collection to allow for 'both' as a valid option. - Modified the implementations page to fetch and display both official and community implementations that fall under this new subtype. - Add sts07142/resumable-upload to the community both(server/client) implementation list --- src/content/config.ts | 2 +- .../implementations/resumable-upload.json | 14 +++++++++ src/pages/implementations.astro | 30 +++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/content/implementations/resumable-upload.json diff --git a/src/content/config.ts b/src/content/config.ts index a3d63c47..1f4a90df 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -46,7 +46,7 @@ const implementations = defineCollection({ description: z.string().describe('HTML allowed'), license: z.string(), type: z.union([z.literal('official'), z.literal('community')]), - subtype: z.union([z.literal('client'), z.literal('server')]).optional(), + subtype: z.union([z.literal('client'), z.literal('server'), z.literal('both')]).optional(), }), }) diff --git a/src/content/implementations/resumable-upload.json b/src/content/implementations/resumable-upload.json new file mode 100644 index 00000000..a739593d --- /dev/null +++ b/src/content/implementations/resumable-upload.json @@ -0,0 +1,14 @@ +{ + "href": "https://github.com/sts07142/resumable-upload", + "authors": [ + { + "name": "sts07142", + "href": "https://github.com/sts07142" + } + ], + "name": "sts07142/resumable-upload", + "description": "A Python implementation of the tus v1.0.0 for server and client, with zero runtime dependencies.", + "license": "MIT", + "type": "community", + "subtype": "both" +} diff --git a/src/pages/implementations.astro b/src/pages/implementations.astro index 53fbc969..a126c9c5 100644 --- a/src/pages/implementations.astro +++ b/src/pages/implementations.astro @@ -6,6 +6,11 @@ import { getCollection } from 'astro:content' const description = 'Explore real-life tus protocol implementations in various languages and platforms, showcasing its versatility and efficiency in file uploads.' +const officialBoth = await getCollection( + 'implementations', + (d) => d.data.type === 'official' && d.data.subtype === 'both' +) + const officialServers = await getCollection( 'implementations', (d) => d.data.type === 'official' && d.data.subtype === 'server' @@ -16,6 +21,11 @@ const officialClients = await getCollection( (d) => d.data.type === 'official' && d.data.subtype === 'client' ) +const communityBothImplementations = await getCollection( + 'implementations', + (d) => d.data.type === 'community' && d.data.subtype === 'both' +) + const communityClientImplementations = await getCollection( 'implementations', (d) => d.data.type === 'community' && d.data.subtype === 'client' @@ -69,6 +79,16 @@ const communityServerImplementations = await getCollection( developers.

+

Servers/Clients

+ + +

Servers