Update CMS client configuration and refactor content organization
The code changes involve a significant update to the configuration of our CMS client. The nature of retrieving content items has been refactored to be more granular, allowing for the identification and fetching of content from specified collections rather than general categories. These modifications improve the efficiency and specificity of content queries. Furthermore, other changes were made to provide a better alignment of our content structure, including the reorganization of content files and renaming of image paths in various components for consistency.
This commit is contained in:
@@ -6,7 +6,6 @@ export namespace Cms {
|
||||
url: string;
|
||||
description: string | undefined;
|
||||
content: unknown;
|
||||
author: string;
|
||||
publishedAt: Date;
|
||||
image: string | undefined;
|
||||
slug: string;
|
||||
@@ -30,6 +29,7 @@ export namespace Cms {
|
||||
}
|
||||
|
||||
export interface GetContentItemsOptions {
|
||||
collection: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
categories?: string[];
|
||||
@@ -65,10 +65,12 @@ export abstract class CmsClient {
|
||||
|
||||
/**
|
||||
* Retrieves a content item by its ID and type.
|
||||
* @param id - The ID of the content item.
|
||||
* @returns A promise that resolves to the content item, or undefined if not found.
|
||||
*/
|
||||
abstract getContentItemById(id: string): Promise<Cms.ContentItem | undefined>;
|
||||
abstract getContentItemBySlug(params: {
|
||||
slug: string;
|
||||
collection: string;
|
||||
}): Promise<Cms.ContentItem | undefined>;
|
||||
|
||||
/**
|
||||
* Retrieves categories based on the provided options.
|
||||
|
||||
Reference in New Issue
Block a user