feature: intergrated directus for posts

This commit is contained in:
libertyoms
2025-04-26 19:27:16 +02:00
parent 08965c3830
commit 809f5c6ff7
11 changed files with 530 additions and 95 deletions

79
types/index.d.ts vendored Normal file
View File

@ -0,0 +1,79 @@
export interface OutputData {
time: number;
blocks: ContentBlock[];
version: string;
}
export interface ContentBlock {
id: string;
type: string;
data:
| ParagraphData
| HeaderData
| ListData
| ImageData
| QuoteData
| CodeData;
}
export interface ParagraphData {
text: string;
}
export interface HeaderData {
text: string;
level: number;
}
export interface ListData {
style: "ordered" | "unordered";
items: string[];
}
export interface ImageData {
file: {
url: string;
width?: number;
height?: number;
};
caption?: string;
}
export interface QuoteData {
text: string;
caption?: string;
}
export interface CodeData {
code: string;
}
export interface Post {
slug: string;
status: string;
user_created: string;
date_created: string;
user_updated: string | null;
date_updated: string | null;
title: string;
content: OutputData | null;
excerpt: string | null;
featured_image: string | null;
imageUrl?: string | null;
}
export interface HeroSection {
id: string;
hero_title?: string;
hero_subtitle?: string;
hero_cover?: string;
hero_buttons?: HeroButton[];
}
interface HeroButton {
label?: string;
link?: string;
}
interface ItemsQuery {
fields?: string[];
}