From 7828f562b6989fdabd42511ea92f1c40df02d4f9 Mon Sep 17 00:00:00 2001 From: Benjamin Otto Date: Mon, 26 Aug 2024 14:14:17 +0200 Subject: [PATCH 1/3] look for slug instead of id --- examples/default/events/Inventory/InventoryAdjusted/index.md | 2 +- .../Inventory/InventoryAdjusted/versioned/0.0.1/index.md | 2 +- .../Inventory/InventoryAdjusted/versioned/1.0.0/index.md | 2 +- src/utils/changelogs/changelogs.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/default/events/Inventory/InventoryAdjusted/index.md b/examples/default/events/Inventory/InventoryAdjusted/index.md index 5c209ece..733fcb19 100644 --- a/examples/default/events/Inventory/InventoryAdjusted/index.md +++ b/examples/default/events/Inventory/InventoryAdjusted/index.md @@ -1,5 +1,5 @@ --- -id: InventoryAdjusted +id: inventuryadjusted name: Inventory adjusted version: 1.0.1 summary: | diff --git a/examples/default/events/Inventory/InventoryAdjusted/versioned/0.0.1/index.md b/examples/default/events/Inventory/InventoryAdjusted/versioned/0.0.1/index.md index 894f1f2e..0227c848 100644 --- a/examples/default/events/Inventory/InventoryAdjusted/versioned/0.0.1/index.md +++ b/examples/default/events/Inventory/InventoryAdjusted/versioned/0.0.1/index.md @@ -1,5 +1,5 @@ --- -id: InventoryAdjusted +id: inventuryadjusted name: Inventory adjusted version: 0.0.1 summary: | diff --git a/examples/default/events/Inventory/InventoryAdjusted/versioned/1.0.0/index.md b/examples/default/events/Inventory/InventoryAdjusted/versioned/1.0.0/index.md index 2740b6c1..026ec9ef 100644 --- a/examples/default/events/Inventory/InventoryAdjusted/versioned/1.0.0/index.md +++ b/examples/default/events/Inventory/InventoryAdjusted/versioned/1.0.0/index.md @@ -1,5 +1,5 @@ --- -id: InventoryAdjusted +id: inventuryadjusted name: Inventory adjusted version: 1.0.0 summary: | diff --git a/src/utils/changelogs/changelogs.ts b/src/utils/changelogs/changelogs.ts index 28590c41..4ec48809 100644 --- a/src/utils/changelogs/changelogs.ts +++ b/src/utils/changelogs/changelogs.ts @@ -4,11 +4,11 @@ import { getCollection, type CollectionEntry } from 'astro:content'; export type ChangeLog = CollectionEntry<'changelogs'>; export const getChangeLogs = async (item: CollectionEntry): Promise => { - const { collection, data } = item; + const { collection, data, slug } = item; // Get all logs for collection type and filter by given collection const logs = await getCollection('changelogs', (log) => { - return log.id.includes(`${collection}/`) && log.id.includes(`/${data.id}/`); + return log.id.includes(`${collection}/`) && log.slug.includes(slug); }); const hydratedLogs = logs.map((log) => { From 42938af488403bcc139cf84ead8f0306d8f667ed Mon Sep 17 00:00:00 2001 From: David Boyne Date: Wed, 11 Sep 2024 18:24:48 +0100 Subject: [PATCH 2/3] Update index.md --- .../Inventory/InventoryAdjusted/versioned/1.0.0/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/default/events/Inventory/InventoryAdjusted/versioned/1.0.0/index.md b/examples/default/events/Inventory/InventoryAdjusted/versioned/1.0.0/index.md index 026ec9ef..ef9d35d2 100644 --- a/examples/default/events/Inventory/InventoryAdjusted/versioned/1.0.0/index.md +++ b/examples/default/events/Inventory/InventoryAdjusted/versioned/1.0.0/index.md @@ -1,5 +1,5 @@ --- -id: inventuryadjusted +id: InventoryAdjusted name: Inventory adjusted version: 1.0.0 summary: | @@ -101,4 +101,4 @@ consumer = KafkaConsumer( for message in consumer: event_data = json.loads(message.value) print(f"Received Inventory Adjusted event: {event_data}") -``` \ No newline at end of file +``` From 9d14db739c4377bd120bb0a6f76c9d48e42ab3e2 Mon Sep 17 00:00:00 2001 From: David Boyne Date: Wed, 11 Sep 2024 18:25:24 +0100 Subject: [PATCH 3/3] Update index.md --- examples/default/events/Inventory/InventoryAdjusted/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/default/events/Inventory/InventoryAdjusted/index.md b/examples/default/events/Inventory/InventoryAdjusted/index.md index 733fcb19..de238c99 100644 --- a/examples/default/events/Inventory/InventoryAdjusted/index.md +++ b/examples/default/events/Inventory/InventoryAdjusted/index.md @@ -1,5 +1,5 @@ --- -id: inventuryadjusted +id: InventoryAdjusted name: Inventory adjusted version: 1.0.1 summary: | @@ -106,4 +106,4 @@ for message in consumer: print(f"Received Inventory Adjusted event: {event_data}") ``` -