Refactor UI component and improve configuration handling
Refactored the components in the site header account section and page.tsx to improve readability. Updated the WordPress client to handle date types correctly. Adjusted the keystatic storage kind to default to 'local' if not specified in the environment variables.
This commit is contained in:
@@ -22,7 +22,7 @@ const github = z.object({
|
||||
});
|
||||
|
||||
const storage = z.union([local, cloud, github]).parse({
|
||||
kind: process.env.KEYSTATIC_STORAGE_KIND,
|
||||
kind: process.env.KEYSTATIC_STORAGE_KIND ?? 'local',
|
||||
project: process.env.KEYSTATIC_STORAGE_PROJECT,
|
||||
repo: process.env.KEYSTATIC_STORAGE_REPO,
|
||||
branchPrefix: process.env.KEYSTATIC_STORAGE_BRANCH_PREFIX,
|
||||
|
||||
@@ -123,7 +123,7 @@ export class WordpressClient implements CmsClient {
|
||||
image,
|
||||
url: item.link,
|
||||
slug: item.slug,
|
||||
publishedAt: new Date(item.date),
|
||||
publishedAt: item.date,
|
||||
categories: categories,
|
||||
tags: tags,
|
||||
parentId,
|
||||
@@ -182,7 +182,7 @@ export class WordpressClient implements CmsClient {
|
||||
title: item.title.rendered,
|
||||
content: item.content.rendered,
|
||||
slug: item.slug,
|
||||
publishedAt: new Date(item.date),
|
||||
publishedAt: item.date,
|
||||
categories,
|
||||
tags,
|
||||
parentId: item.parent?.toString(),
|
||||
|
||||
Reference in New Issue
Block a user