From e833e5cacca0ad2ee7fe5dc258cbc599dceece58 Mon Sep 17 00:00:00 2001 From: Danny Koppenhagen Date: Tue, 10 Mar 2026 20:14:20 +0100 Subject: [PATCH 1/3] feat(blog): add sticky field to blog entry metadata - Add optional `sticky` boolean field to BlogEntryMeta interface - Include sticky flag in light blog list generation when present - Allows marking blog entries as sticky for featured/pinned display --- blog/blog.types.ts | 1 + blog/blog.utils.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/blog/blog.types.ts b/blog/blog.types.ts index fbe1e7d..9fd8c28 100644 --- a/blog/blog.types.ts +++ b/blog/blog.types.ts @@ -13,6 +13,7 @@ export interface BlogEntryMeta { mail: string; published: string; language: string; + sticky?: boolean; header?: ImageDimensions & { url: string }; // Optional fields (only included if present) author2?: string; diff --git a/blog/blog.utils.ts b/blog/blog.utils.ts index af93e1c..3544e8f 100644 --- a/blog/blog.utils.ts +++ b/blog/blog.utils.ts @@ -18,6 +18,7 @@ export function makeLightBlogList(fullList: BlogEntryFull[]): BlogEntry[] { }, }; + if (entry.meta.sticky) { result.meta.sticky = entry.meta.sticky; } if (entry.meta.author2) { result.meta.author2 = entry.meta.author2; } if (entry.meta.mail2) { result.meta.mail2 = entry.meta.mail2; } if (entry.meta.isUpdatePost) { result.meta.isUpdatePost = entry.meta.isUpdatePost; } From f5677fde525775952b640b7733ea1480924f23c6 Mon Sep 17 00:00:00 2001 From: Danny Koppenhagen Date: Tue, 10 Mar 2026 20:21:46 +0100 Subject: [PATCH 2/3] test(blog): update sticky field assertion in light blog list - Move sticky field assertion to included fields section - Verify sticky property is present in light blog metadata - Remove outdated assertion that sticky should not be included - Reflects recent change to include sticky in light blog list output --- blog/blog.utils.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/blog.utils.spec.ts b/blog/blog.utils.spec.ts index fc93c18..2a8f5fa 100644 --- a/blog/blog.utils.spec.ts +++ b/blog/blog.utils.spec.ts @@ -91,6 +91,7 @@ describe('makeLightBlogList', () => { expect(meta.published).toBe(publishedDate); expect(meta.language).toBe('de'); expect(meta.header).toEqual({ url: 'img.jpg', width: 100, height: 50 }); + expect(Object.hasOwn(meta, 'sticky')).toBe(true); // These should NOT be included in light version expect(Object.hasOwn(meta, 'hidden')).toBe(false); @@ -100,7 +101,6 @@ describe('makeLightBlogList', () => { expect(Object.hasOwn(meta, 'bioHeading')).toBe(false); expect(Object.hasOwn(meta, 'bio2')).toBe(false); expect(Object.hasOwn(meta, 'bio2Heading')).toBe(false); - expect(Object.hasOwn(meta, 'sticky')).toBe(false); }); it('should include author2 and mail2 if present', () => { From df37d8b38f7640ce46bf13c47e28caddb6284852 Mon Sep 17 00:00:00 2001 From: Danny Koppenhagen Date: Tue, 10 Mar 2026 20:23:20 +0100 Subject: [PATCH 3/3] Update blog/blog.utils.spec.ts Co-authored-by: Ferdinand Malcher --- blog/blog.utils.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/blog.utils.spec.ts b/blog/blog.utils.spec.ts index 2a8f5fa..0e7c398 100644 --- a/blog/blog.utils.spec.ts +++ b/blog/blog.utils.spec.ts @@ -91,7 +91,7 @@ describe('makeLightBlogList', () => { expect(meta.published).toBe(publishedDate); expect(meta.language).toBe('de'); expect(meta.header).toEqual({ url: 'img.jpg', width: 100, height: 50 }); - expect(Object.hasOwn(meta, 'sticky')).toBe(true); + expect(meta.sticky).toBe(true); // These should NOT be included in light version expect(Object.hasOwn(meta, 'hidden')).toBe(false);