Optimize content fetching and update configurations

Content fetching in the marketing section has been refactored to utilize the Next.js cache, which significantly improves performance. The date format of publishedAt has been updated to be more consistent across files. Code related to CSRF token, fonts, and metadata has been refactored into separate files for easier maintenance and readability.
This commit is contained in:
giancarlo
2024-04-19 19:21:54 +08:00
parent c121a3bdad
commit b71b580331
12 changed files with 116 additions and 69 deletions

View File

@@ -16,8 +16,6 @@ export class KeystaticClient implements CmsClient {
const docs = await reader.collections[collection].all();
console.log(docs);
const startOffset = options?.offset ?? 0;
const endOffset = startOffset + (options?.limit ?? 10);
@@ -144,7 +142,7 @@ export class KeystaticClient implements CmsClient {
url: item.slug,
slug: item.slug,
description: item.entry.description,
publishedAt,
publishedAt: publishedAt.toISOString(),
content,
image: item.entry.image ?? undefined,
categories: