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
1 change: 1 addition & 0 deletions blog/blog.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion blog/blog.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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', () => {
Expand Down
1 change: 1 addition & 0 deletions blog/blog.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down