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.spec.ts b/blog/blog.utils.spec.ts index fc93c18..0e7c398 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(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', () => { 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; }