Compare commits
1 Commits
main
...
videos_sec
| Author | SHA1 | Date |
|---|---|---|
|
|
ef1740e62d |
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
import { Icon } from "astro-icon/components";
|
||||
import { Image } from "astro:assets";
|
||||
|
||||
const { props } = Astro.props;
|
||||
const textColor = props.textColor || "";
|
||||
|
||||
const imageUrl = props.image || "";
|
||||
//const bgClass = props.type === 'text'? `bg-[${props.bgColor}]` : `bg-[url(${props.image})] bg-cover`
|
||||
---
|
||||
|
||||
{
|
||||
props.type !== "imgText" && (
|
||||
<div class="aspect-square overflow-hidden">
|
||||
<div
|
||||
class={`flex flex-col justify-center h-full bg-[${props.bgColor}]`}
|
||||
>
|
||||
{props.type === "text" && (
|
||||
<div class="p-8 sm:p-16 md:p-8 xl:p-16 flex flex-col justify-between h-full">
|
||||
<Icon
|
||||
name={props.icon}
|
||||
class={`text-8xl text-[${textColor}] hidden lg:block`}
|
||||
/>
|
||||
<p class={`text-[${textColor}]`}>{props.text}</p>
|
||||
</div>
|
||||
)}
|
||||
{props.type === "image" && (
|
||||
<div class="object-cover aspect-square flex">
|
||||
<Image
|
||||
class="w-full object-cover"
|
||||
src={props.image}
|
||||
alt={props.text || ""}
|
||||
width="400"
|
||||
height="400"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
props.type === "imgText" && (
|
||||
<div
|
||||
class={`flex flex-col justify-between h-full bg-[${props.bgColor}]`}
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-0 p-8 font-bold">
|
||||
<div class="px-12 py-10">
|
||||
<Icon name={props.icon} class="text-3xl" />
|
||||
<p class={`font-primary text-xl text-[${textColor}]`}>
|
||||
{props.text}
|
||||
</p>
|
||||
</div>
|
||||
<div class="object-cover aspect-square flex">
|
||||
<img
|
||||
class="w-full h-auto object-cover"
|
||||
src={props.image}
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
import { Icon } from "astro-icon/components";
|
||||
import { Image } from "astro:assets";
|
||||
|
||||
const { props } = Astro.props;
|
||||
const textColor = props.textColor || "";
|
||||
|
||||
const imageUrl = props.image || "";
|
||||
//const bgClass = props.type === 'text'? `bg-[${props.bgColor}]` : `bg-[url(${props.image})] bg-cover`
|
||||
---
|
||||
|
||||
{
|
||||
props.type !== "imgText" && (
|
||||
<div class="aspect-square overflow-hidden">
|
||||
<div
|
||||
class={`flex flex-col justify-center h-full bg-[${props.bgColor}]`}
|
||||
>
|
||||
{props.type === "text" && (
|
||||
<div class="p-8 sm:p-16 md:p-8 xl:p-16 flex flex-col justify-between h-full">
|
||||
<Icon
|
||||
name={props.icon}
|
||||
class={`text-8xl text-[${textColor}] hidden lg:block`}
|
||||
/>
|
||||
<p class={`text-[${textColor}]`}>{props.text}</p>
|
||||
</div>
|
||||
)}
|
||||
{props.type === "image" && (
|
||||
<div class="object-cover aspect-square flex">
|
||||
<Image
|
||||
class="w-full object-cover"
|
||||
src={props.image}
|
||||
alt={props.text || ""}
|
||||
width="400"
|
||||
height="400"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
props.type === "imgText" && (
|
||||
<div
|
||||
class={`flex flex-col justify-between h-full bg-[${props.bgColor}]`}
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-0 p-8 font-bold">
|
||||
<div class="px-12 py-10">
|
||||
<Icon name={props.icon} class="text-3xl" />
|
||||
<p class={`font-primary text-xl text-[${textColor}]`}>
|
||||
{props.text}
|
||||
</p>
|
||||
</div>
|
||||
<div class="object-cover aspect-square flex">
|
||||
<img
|
||||
class="w-full h-auto object-cover"
|
||||
src={props.image}
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -26,4 +26,17 @@ const news = defineCollection({
|
|||
}),
|
||||
});
|
||||
|
||||
export const collections = { news };
|
||||
const videos = defineCollection({
|
||||
loader: glob({ pattern: "**/*.md", base: "./src/content/videos" }),
|
||||
schema: ({ image }) => z.object({
|
||||
locale: z.string().describe("Video main language"),
|
||||
title: z.string(),
|
||||
date: z.date(),
|
||||
draft: z.boolean().optional(),
|
||||
video_yt: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
thumbnail: image().optional().describe("Video thumbnail image"),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = { news, videos };
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
locale: es
|
||||
title: test
|
||||
---
|
||||
|
||||
# test
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
{"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["news","documentaries"]},"Node":{"type":"Node","resolveType":"nodeDocument"},"DocumentNode":{"type":"DocumentNode","resolveType":"multiCollectionDocument","createDocument":"create","updateDocument":"update"},"News":{"type":"News","resolveType":"collectionDocument","collection":"news","createNews":"create","updateNews":"update"},"NewsConnection":{"type":"NewsConnection","resolveType":"collectionDocumentList","collection":"news"},"Documentaries":{"type":"Documentaries","resolveType":"collectionDocument","collection":"documentaries","createDocumentaries":"create","updateDocumentaries":"update"},"DocumentariesConnection":{"type":"DocumentariesConnection","resolveType":"collectionDocumentList","collection":"documentaries"}}
|
||||
{"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["news","videos"]},"Node":{"type":"Node","resolveType":"nodeDocument"},"DocumentNode":{"type":"DocumentNode","resolveType":"multiCollectionDocument","createDocument":"create","updateDocument":"update"},"News":{"type":"News","resolveType":"collectionDocument","collection":"news","createNews":"create","updateNews":"update"},"NewsConnection":{"type":"NewsConnection","resolveType":"collectionDocumentList","collection":"news"},"Videos":{"type":"Videos","resolveType":"collectionDocument","collection":"videos","createVideos":"create","updateVideos":"update"},"VideosConnection":{"type":"VideosConnection","resolveType":"collectionDocumentList","collection":"videos"}}
|
||||
|
|
@ -1 +1 @@
|
|||
{"version":{"fullVersion":"2.4.0","major":"2","minor":"4","patch":"0"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"news","label":"News","path":"src/content/news","format":"md","match":{"include":"**/*"},"ui":{"filename":{"readonly":false}},"fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"},{"label":"Português","value":"pt"},{"label":"Kinyarwanda","value":"rw"},{"label":"Frances","value":"fr"}],"namespace":["news","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["news","title"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["news","date"],"searchable":true,"uid":false},{"type":"string","name":"slug","label":"Slug","namespace":["news","slug"],"searchable":true,"uid":false},{"type":"string","name":"place","label":"Place","namespace":["news","place"],"searchable":true,"uid":false},{"type":"string","name":"country","label":"Country","namespace":["news","country"],"searchable":true,"uid":false},{"type":"string","name":"city","label":"City","namespace":["news","city"],"searchable":true,"uid":false},{"type":"image","name":"thumbnail","label":"Thumbnail URL","namespace":["news","thumbnail"],"searchable":false,"uid":false},{"type":"image","name":"thumbnail_square","label":"Thumbnail Square URL","namespace":["news","thumbnail_square"],"searchable":false,"uid":false},{"type":"string","name":"tags","label":"Tags","list":true,"namespace":["news","tags"],"searchable":true,"uid":false},{"type":"object","name":"gallery","label":"Gallery","list":true,"fields":[{"type":"image","name":"image","label":"Image","namespace":["news","gallery","image"],"searchable":false,"uid":false}],"namespace":["news","gallery"],"searchable":true,"uid":false},{"type":"string","name":"youtube","label":"YouTube ID","namespace":["news","youtube"],"searchable":true,"uid":false},{"type":"boolean","name":"draft","label":"Draft","namespace":["news","draft"],"searchable":true,"uid":false},{"type":"rich-text","name":"body","label":"Content","isBody":true,"namespace":["news","body"],"searchable":true,"parser":{"type":"markdown"},"uid":false}],"namespace":["news"]},{"name":"documentaries","label":"Documentaries","path":"src/content/documentaries","format":"md","fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"},{"label":"Português","value":"pt"},{"label":"Kinyarwanda","value":"rw"}],"namespace":["documentaries","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["documentaries","title"],"searchable":true,"uid":false},{"type":"string","name":"video_yt","label":"YouTube ID","namespace":["documentaries","video_yt"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["documentaries","date"],"searchable":true,"uid":false}],"namespace":["documentaries"]}],"config":{"media":{"tina":{"publicFolder":"public","mediaRoot":"public/images"}}}}
|
||||
{"version":{"fullVersion":"2.4.0","major":"2","minor":"4","patch":"0"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"news","label":"News","path":"src/content/news","format":"md","match":{"include":"**/*"},"ui":{"filename":{"readonly":false}},"fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"},{"label":"Português","value":"pt"},{"label":"Kinyarwanda","value":"rw"},{"label":"Frances","value":"fr"}],"namespace":["news","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["news","title"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["news","date"],"searchable":true,"uid":false},{"type":"string","name":"slug","label":"Slug","namespace":["news","slug"],"searchable":true,"uid":false},{"type":"string","name":"place","label":"Place","namespace":["news","place"],"searchable":true,"uid":false},{"type":"string","name":"country","label":"Country","namespace":["news","country"],"searchable":true,"uid":false},{"type":"string","name":"city","label":"City","namespace":["news","city"],"searchable":true,"uid":false},{"type":"image","name":"thumbnail","label":"Thumbnail URL","namespace":["news","thumbnail"],"searchable":false,"uid":false},{"type":"image","name":"thumbnail_square","label":"Thumbnail Square URL","namespace":["news","thumbnail_square"],"searchable":false,"uid":false},{"type":"string","name":"tags","label":"Tags","list":true,"namespace":["news","tags"],"searchable":true,"uid":false},{"type":"object","name":"gallery","label":"Gallery","list":true,"fields":[{"type":"image","name":"image","label":"Image","namespace":["news","gallery","image"],"searchable":false,"uid":false}],"namespace":["news","gallery"],"searchable":true,"uid":false},{"type":"string","name":"youtube","label":"YouTube ID","namespace":["news","youtube"],"searchable":true,"uid":false},{"type":"boolean","name":"draft","label":"Draft","namespace":["news","draft"],"searchable":true,"uid":false},{"type":"rich-text","name":"body","label":"Content","isBody":true,"namespace":["news","body"],"searchable":true,"parser":{"type":"markdown"},"uid":false}],"namespace":["news"]},{"name":"videos","label":"Videos","path":"src/content/videos","format":"md","fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"},{"label":"Português","value":"pt"},{"label":"Kinyarwanda","value":"rw"}],"namespace":["videos","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["videos","title"],"searchable":true,"uid":false},{"type":"string","name":"video_yt","label":"YouTube ID","namespace":["videos","video_yt"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["videos","date"],"searchable":true,"uid":false},{"type":"string","name":"slug","label":"Slug","namespace":["videos","slug"],"searchable":true,"uid":false},{"type":"string","name":"description","label":"Description","ui":{"component":"textarea"},"namespace":["videos","description"],"searchable":true,"uid":false},{"type":"string","name":"thumbnail","label":"Thumbnail URL","namespace":["videos","thumbnail"],"searchable":true,"uid":false},{"type":"boolean","name":"draft","label":"Draft","namespace":["videos","draft"],"searchable":true,"uid":false}],"namespace":["videos"]}],"config":{"media":{"tina":{"publicFolder":"public","mediaRoot":"public/images"}}}}
|
||||
|
|
@ -127,9 +127,9 @@ var config_default = defineConfig({
|
|||
]
|
||||
},
|
||||
{
|
||||
name: "documentaries",
|
||||
label: "Documentaries",
|
||||
path: "src/content/documentaries",
|
||||
name: "videos",
|
||||
label: "Videos",
|
||||
path: "src/content/videos",
|
||||
format: "md",
|
||||
fields: [
|
||||
{
|
||||
|
|
@ -160,6 +160,29 @@ var config_default = defineConfig({
|
|||
name: "date",
|
||||
label: "Date",
|
||||
required: true
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
name: "slug",
|
||||
label: "Slug"
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
name: "description",
|
||||
label: "Description",
|
||||
ui: {
|
||||
component: "textarea"
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
name: "thumbnail",
|
||||
label: "Thumbnail URL"
|
||||
},
|
||||
{
|
||||
type: "boolean",
|
||||
name: "draft",
|
||||
label: "Draft"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,14 @@ fragment NewsParts on News {
|
|||
body
|
||||
}
|
||||
|
||||
fragment DocumentariesParts on Documentaries {
|
||||
fragment VideosParts on Videos {
|
||||
__typename
|
||||
locale
|
||||
title
|
||||
video_yt
|
||||
date
|
||||
slug
|
||||
description
|
||||
thumbnail
|
||||
draft
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ query newsConnection($before: String, $after: String, $first: Float, $last: Floa
|
|||
}
|
||||
}
|
||||
|
||||
query documentaries($relativePath: String!) {
|
||||
documentaries(relativePath: $relativePath) {
|
||||
query videos($relativePath: String!) {
|
||||
videos(relativePath: $relativePath) {
|
||||
... on Document {
|
||||
_sys {
|
||||
filename
|
||||
|
|
@ -67,12 +67,12 @@ query documentaries($relativePath: String!) {
|
|||
}
|
||||
id
|
||||
}
|
||||
...DocumentariesParts
|
||||
...VideosParts
|
||||
}
|
||||
}
|
||||
|
||||
query documentariesConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: DocumentariesFilter) {
|
||||
documentariesConnection(
|
||||
query videosConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: VideosFilter) {
|
||||
videosConnection(
|
||||
before: $before
|
||||
after: $after
|
||||
first: $first
|
||||
|
|
@ -102,7 +102,7 @@ query documentariesConnection($before: String, $after: String, $first: Float, $l
|
|||
}
|
||||
id
|
||||
}
|
||||
...DocumentariesParts
|
||||
...VideosParts
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ type Query {
|
|||
document(collection: String, relativePath: String): DocumentNode!
|
||||
news(relativePath: String): News!
|
||||
newsConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: NewsFilter): NewsConnection!
|
||||
documentaries(relativePath: String): Documentaries!
|
||||
documentariesConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentariesFilter): DocumentariesConnection!
|
||||
videos(relativePath: String): Videos!
|
||||
videosConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: VideosFilter): VideosConnection!
|
||||
}
|
||||
|
||||
input DocumentFilter {
|
||||
news: NewsFilter
|
||||
documentaries: DocumentariesFilter
|
||||
videos: VideosFilter
|
||||
}
|
||||
|
||||
type DocumentConnectionEdges {
|
||||
|
|
@ -88,7 +88,7 @@ type Collection {
|
|||
documents(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentFilter, folder: String): DocumentConnection!
|
||||
}
|
||||
|
||||
union DocumentNode = News | Documentaries | Folder
|
||||
union DocumentNode = News | Videos | Folder
|
||||
|
||||
type NewsGallery {
|
||||
image: String
|
||||
|
|
@ -179,32 +179,40 @@ type NewsConnection implements Connection {
|
|||
edges: [NewsConnectionEdges]
|
||||
}
|
||||
|
||||
type Documentaries implements Node & Document {
|
||||
type Videos implements Node & Document {
|
||||
locale: String
|
||||
title: String!
|
||||
video_yt: String
|
||||
date: String!
|
||||
slug: String
|
||||
description: String
|
||||
thumbnail: String
|
||||
draft: Boolean
|
||||
id: ID!
|
||||
_sys: SystemInfo!
|
||||
_values: JSON!
|
||||
}
|
||||
|
||||
input DocumentariesFilter {
|
||||
input VideosFilter {
|
||||
locale: StringFilter
|
||||
title: StringFilter
|
||||
video_yt: StringFilter
|
||||
date: DatetimeFilter
|
||||
slug: StringFilter
|
||||
description: StringFilter
|
||||
thumbnail: StringFilter
|
||||
draft: BooleanFilter
|
||||
}
|
||||
|
||||
type DocumentariesConnectionEdges {
|
||||
type VideosConnectionEdges {
|
||||
cursor: String!
|
||||
node: Documentaries
|
||||
node: Videos
|
||||
}
|
||||
|
||||
type DocumentariesConnection implements Connection {
|
||||
type VideosConnection implements Connection {
|
||||
pageInfo: PageInfo!
|
||||
totalCount: Float!
|
||||
edges: [DocumentariesConnectionEdges]
|
||||
edges: [VideosConnectionEdges]
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
|
@ -215,19 +223,19 @@ type Mutation {
|
|||
createFolder(collection: String, relativePath: String!): DocumentNode!
|
||||
updateNews(relativePath: String!, params: NewsMutation!): News!
|
||||
createNews(relativePath: String!, params: NewsMutation!): News!
|
||||
updateDocumentaries(relativePath: String!, params: DocumentariesMutation!): Documentaries!
|
||||
createDocumentaries(relativePath: String!, params: DocumentariesMutation!): Documentaries!
|
||||
updateVideos(relativePath: String!, params: VideosMutation!): Videos!
|
||||
createVideos(relativePath: String!, params: VideosMutation!): Videos!
|
||||
}
|
||||
|
||||
input DocumentUpdateMutation {
|
||||
news: NewsMutation
|
||||
documentaries: DocumentariesMutation
|
||||
videos: VideosMutation
|
||||
relativePath: String
|
||||
}
|
||||
|
||||
input DocumentMutation {
|
||||
news: NewsMutation
|
||||
documentaries: DocumentariesMutation
|
||||
videos: VideosMutation
|
||||
}
|
||||
|
||||
input NewsGalleryMutation {
|
||||
|
|
@ -251,11 +259,15 @@ input NewsMutation {
|
|||
body: JSON
|
||||
}
|
||||
|
||||
input DocumentariesMutation {
|
||||
input VideosMutation {
|
||||
locale: String
|
||||
title: String
|
||||
video_yt: String
|
||||
date: String
|
||||
slug: String
|
||||
description: String
|
||||
thumbnail: String
|
||||
draft: Boolean
|
||||
}
|
||||
|
||||
schema {
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ export type Query = {
|
|||
document: DocumentNode;
|
||||
news: News;
|
||||
newsConnection: NewsConnection;
|
||||
documentaries: Documentaries;
|
||||
documentariesConnection: DocumentariesConnection;
|
||||
videos: Videos;
|
||||
videosConnection: VideosConnection;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -125,23 +125,23 @@ export type QueryNewsConnectionArgs = {
|
|||
};
|
||||
|
||||
|
||||
export type QueryDocumentariesArgs = {
|
||||
export type QueryVideosArgs = {
|
||||
relativePath?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryDocumentariesConnectionArgs = {
|
||||
export type QueryVideosConnectionArgs = {
|
||||
before?: InputMaybe<Scalars['String']['input']>;
|
||||
after?: InputMaybe<Scalars['String']['input']>;
|
||||
first?: InputMaybe<Scalars['Float']['input']>;
|
||||
last?: InputMaybe<Scalars['Float']['input']>;
|
||||
sort?: InputMaybe<Scalars['String']['input']>;
|
||||
filter?: InputMaybe<DocumentariesFilter>;
|
||||
filter?: InputMaybe<VideosFilter>;
|
||||
};
|
||||
|
||||
export type DocumentFilter = {
|
||||
news?: InputMaybe<NewsFilter>;
|
||||
documentaries?: InputMaybe<DocumentariesFilter>;
|
||||
videos?: InputMaybe<VideosFilter>;
|
||||
};
|
||||
|
||||
export type DocumentConnectionEdges = {
|
||||
|
|
@ -181,7 +181,7 @@ export type CollectionDocumentsArgs = {
|
|||
folder?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type DocumentNode = News | Documentaries | Folder;
|
||||
export type DocumentNode = News | Videos | Folder;
|
||||
|
||||
export type NewsGallery = {
|
||||
__typename?: 'NewsGallery';
|
||||
|
|
@ -276,35 +276,43 @@ export type NewsConnection = Connection & {
|
|||
edges?: Maybe<Array<Maybe<NewsConnectionEdges>>>;
|
||||
};
|
||||
|
||||
export type Documentaries = Node & Document & {
|
||||
__typename?: 'Documentaries';
|
||||
export type Videos = Node & Document & {
|
||||
__typename?: 'Videos';
|
||||
locale?: Maybe<Scalars['String']['output']>;
|
||||
title: Scalars['String']['output'];
|
||||
video_yt?: Maybe<Scalars['String']['output']>;
|
||||
date: Scalars['String']['output'];
|
||||
slug?: Maybe<Scalars['String']['output']>;
|
||||
description?: Maybe<Scalars['String']['output']>;
|
||||
thumbnail?: Maybe<Scalars['String']['output']>;
|
||||
draft?: Maybe<Scalars['Boolean']['output']>;
|
||||
id: Scalars['ID']['output'];
|
||||
_sys: SystemInfo;
|
||||
_values: Scalars['JSON']['output'];
|
||||
};
|
||||
|
||||
export type DocumentariesFilter = {
|
||||
export type VideosFilter = {
|
||||
locale?: InputMaybe<StringFilter>;
|
||||
title?: InputMaybe<StringFilter>;
|
||||
video_yt?: InputMaybe<StringFilter>;
|
||||
date?: InputMaybe<DatetimeFilter>;
|
||||
slug?: InputMaybe<StringFilter>;
|
||||
description?: InputMaybe<StringFilter>;
|
||||
thumbnail?: InputMaybe<StringFilter>;
|
||||
draft?: InputMaybe<BooleanFilter>;
|
||||
};
|
||||
|
||||
export type DocumentariesConnectionEdges = {
|
||||
__typename?: 'DocumentariesConnectionEdges';
|
||||
export type VideosConnectionEdges = {
|
||||
__typename?: 'VideosConnectionEdges';
|
||||
cursor: Scalars['String']['output'];
|
||||
node?: Maybe<Documentaries>;
|
||||
node?: Maybe<Videos>;
|
||||
};
|
||||
|
||||
export type DocumentariesConnection = Connection & {
|
||||
__typename?: 'DocumentariesConnection';
|
||||
export type VideosConnection = Connection & {
|
||||
__typename?: 'VideosConnection';
|
||||
pageInfo: PageInfo;
|
||||
totalCount: Scalars['Float']['output'];
|
||||
edges?: Maybe<Array<Maybe<DocumentariesConnectionEdges>>>;
|
||||
edges?: Maybe<Array<Maybe<VideosConnectionEdges>>>;
|
||||
};
|
||||
|
||||
export type Mutation = {
|
||||
|
|
@ -316,8 +324,8 @@ export type Mutation = {
|
|||
createFolder: DocumentNode;
|
||||
updateNews: News;
|
||||
createNews: News;
|
||||
updateDocumentaries: Documentaries;
|
||||
createDocumentaries: Documentaries;
|
||||
updateVideos: Videos;
|
||||
createVideos: Videos;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -366,26 +374,26 @@ export type MutationCreateNewsArgs = {
|
|||
};
|
||||
|
||||
|
||||
export type MutationUpdateDocumentariesArgs = {
|
||||
export type MutationUpdateVideosArgs = {
|
||||
relativePath: Scalars['String']['input'];
|
||||
params: DocumentariesMutation;
|
||||
params: VideosMutation;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateDocumentariesArgs = {
|
||||
export type MutationCreateVideosArgs = {
|
||||
relativePath: Scalars['String']['input'];
|
||||
params: DocumentariesMutation;
|
||||
params: VideosMutation;
|
||||
};
|
||||
|
||||
export type DocumentUpdateMutation = {
|
||||
news?: InputMaybe<NewsMutation>;
|
||||
documentaries?: InputMaybe<DocumentariesMutation>;
|
||||
videos?: InputMaybe<VideosMutation>;
|
||||
relativePath?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type DocumentMutation = {
|
||||
news?: InputMaybe<NewsMutation>;
|
||||
documentaries?: InputMaybe<DocumentariesMutation>;
|
||||
videos?: InputMaybe<VideosMutation>;
|
||||
};
|
||||
|
||||
export type NewsGalleryMutation = {
|
||||
|
|
@ -409,16 +417,20 @@ export type NewsMutation = {
|
|||
body?: InputMaybe<Scalars['JSON']['input']>;
|
||||
};
|
||||
|
||||
export type DocumentariesMutation = {
|
||||
export type VideosMutation = {
|
||||
locale?: InputMaybe<Scalars['String']['input']>;
|
||||
title?: InputMaybe<Scalars['String']['input']>;
|
||||
video_yt?: InputMaybe<Scalars['String']['input']>;
|
||||
date?: InputMaybe<Scalars['String']['input']>;
|
||||
slug?: InputMaybe<Scalars['String']['input']>;
|
||||
description?: InputMaybe<Scalars['String']['input']>;
|
||||
thumbnail?: InputMaybe<Scalars['String']['input']>;
|
||||
draft?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
};
|
||||
|
||||
export type NewsPartsFragment = { __typename: 'News', locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, gallery?: Array<{ __typename: 'NewsGallery', image?: string | null } | null> | null };
|
||||
|
||||
export type DocumentariesPartsFragment = { __typename: 'Documentaries', locale?: string | null, title: string, video_yt?: string | null, date: string };
|
||||
export type VideosPartsFragment = { __typename: 'Videos', locale?: string | null, title: string, video_yt?: string | null, date: string, slug?: string | null, description?: string | null, thumbnail?: string | null, draft?: boolean | null };
|
||||
|
||||
export type NewsQueryVariables = Exact<{
|
||||
relativePath: Scalars['String']['input'];
|
||||
|
|
@ -439,24 +451,24 @@ export type NewsConnectionQueryVariables = Exact<{
|
|||
|
||||
export type NewsConnectionQuery = { __typename?: 'Query', newsConnection: { __typename?: 'NewsConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'NewsConnectionEdges', cursor: string, node?: { __typename: 'News', id: string, locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, gallery?: Array<{ __typename: 'NewsGallery', image?: string | null } | null> | null } | null } | null> | null } };
|
||||
|
||||
export type DocumentariesQueryVariables = Exact<{
|
||||
export type VideosQueryVariables = Exact<{
|
||||
relativePath: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type DocumentariesQuery = { __typename?: 'Query', documentaries: { __typename: 'Documentaries', id: string, locale?: string | null, title: string, video_yt?: string | null, date: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } };
|
||||
export type VideosQuery = { __typename?: 'Query', videos: { __typename: 'Videos', id: string, locale?: string | null, title: string, video_yt?: string | null, date: string, slug?: string | null, description?: string | null, thumbnail?: string | null, draft?: boolean | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } };
|
||||
|
||||
export type DocumentariesConnectionQueryVariables = Exact<{
|
||||
export type VideosConnectionQueryVariables = Exact<{
|
||||
before?: InputMaybe<Scalars['String']['input']>;
|
||||
after?: InputMaybe<Scalars['String']['input']>;
|
||||
first?: InputMaybe<Scalars['Float']['input']>;
|
||||
last?: InputMaybe<Scalars['Float']['input']>;
|
||||
sort?: InputMaybe<Scalars['String']['input']>;
|
||||
filter?: InputMaybe<DocumentariesFilter>;
|
||||
filter?: InputMaybe<VideosFilter>;
|
||||
}>;
|
||||
|
||||
|
||||
export type DocumentariesConnectionQuery = { __typename?: 'Query', documentariesConnection: { __typename?: 'DocumentariesConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'DocumentariesConnectionEdges', cursor: string, node?: { __typename: 'Documentaries', id: string, locale?: string | null, title: string, video_yt?: string | null, date: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } | null } | null> | null } };
|
||||
export type VideosConnectionQuery = { __typename?: 'Query', videosConnection: { __typename?: 'VideosConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'VideosConnectionEdges', cursor: string, node?: { __typename: 'Videos', id: string, locale?: string | null, title: string, video_yt?: string | null, date: string, slug?: string | null, description?: string | null, thumbnail?: string | null, draft?: boolean | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } | null } | null> | null } };
|
||||
|
||||
export const NewsPartsFragmentDoc = gql`
|
||||
fragment NewsParts on News {
|
||||
|
|
@ -480,13 +492,17 @@ export const NewsPartsFragmentDoc = gql`
|
|||
body
|
||||
}
|
||||
`;
|
||||
export const DocumentariesPartsFragmentDoc = gql`
|
||||
fragment DocumentariesParts on Documentaries {
|
||||
export const VideosPartsFragmentDoc = gql`
|
||||
fragment VideosParts on Videos {
|
||||
__typename
|
||||
locale
|
||||
title
|
||||
video_yt
|
||||
date
|
||||
slug
|
||||
description
|
||||
thumbnail
|
||||
draft
|
||||
}
|
||||
`;
|
||||
export const NewsDocument = gql`
|
||||
|
|
@ -546,9 +562,9 @@ export const NewsConnectionDocument = gql`
|
|||
}
|
||||
}
|
||||
${NewsPartsFragmentDoc}`;
|
||||
export const DocumentariesDocument = gql`
|
||||
query documentaries($relativePath: String!) {
|
||||
documentaries(relativePath: $relativePath) {
|
||||
export const VideosDocument = gql`
|
||||
query videos($relativePath: String!) {
|
||||
videos(relativePath: $relativePath) {
|
||||
... on Document {
|
||||
_sys {
|
||||
filename
|
||||
|
|
@ -561,13 +577,13 @@ export const DocumentariesDocument = gql`
|
|||
}
|
||||
id
|
||||
}
|
||||
...DocumentariesParts
|
||||
...VideosParts
|
||||
}
|
||||
}
|
||||
${DocumentariesPartsFragmentDoc}`;
|
||||
export const DocumentariesConnectionDocument = gql`
|
||||
query documentariesConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: DocumentariesFilter) {
|
||||
documentariesConnection(
|
||||
${VideosPartsFragmentDoc}`;
|
||||
export const VideosConnectionDocument = gql`
|
||||
query videosConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: VideosFilter) {
|
||||
videosConnection(
|
||||
before: $before
|
||||
after: $after
|
||||
first: $first
|
||||
|
|
@ -597,12 +613,12 @@ export const DocumentariesConnectionDocument = gql`
|
|||
}
|
||||
id
|
||||
}
|
||||
...DocumentariesParts
|
||||
...VideosParts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
${DocumentariesPartsFragmentDoc}`;
|
||||
${VideosPartsFragmentDoc}`;
|
||||
export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R>
|
||||
export function getSdk<C>(requester: Requester<C>) {
|
||||
return {
|
||||
|
|
@ -612,11 +628,11 @@ export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C)
|
|||
newsConnection(variables?: NewsConnectionQueryVariables, options?: C): Promise<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}> {
|
||||
return requester<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}, NewsConnectionQueryVariables>(NewsConnectionDocument, variables, options);
|
||||
},
|
||||
documentaries(variables: DocumentariesQueryVariables, options?: C): Promise<{data: DocumentariesQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesQueryVariables, query: string}> {
|
||||
return requester<{data: DocumentariesQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesQueryVariables, query: string}, DocumentariesQueryVariables>(DocumentariesDocument, variables, options);
|
||||
videos(variables: VideosQueryVariables, options?: C): Promise<{data: VideosQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: VideosQueryVariables, query: string}> {
|
||||
return requester<{data: VideosQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: VideosQueryVariables, query: string}, VideosQueryVariables>(VideosDocument, variables, options);
|
||||
},
|
||||
documentariesConnection(variables?: DocumentariesConnectionQueryVariables, options?: C): Promise<{data: DocumentariesConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesConnectionQueryVariables, query: string}> {
|
||||
return requester<{data: DocumentariesConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesConnectionQueryVariables, query: string}, DocumentariesConnectionQueryVariables>(DocumentariesConnectionDocument, variables, options);
|
||||
videosConnection(variables?: VideosConnectionQueryVariables, options?: C): Promise<{data: VideosConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: VideosConnectionQueryVariables, query: string}> {
|
||||
return requester<{data: VideosConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: VideosConnectionQueryVariables, query: string}, VideosConnectionQueryVariables>(VideosConnectionDocument, variables, options);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,9 +128,9 @@ export default defineConfig({
|
|||
],
|
||||
},
|
||||
{
|
||||
name: "documentaries",
|
||||
label: "Documentaries",
|
||||
path: "src/content/documentaries",
|
||||
name: "videos",
|
||||
label: "Videos",
|
||||
path: "src/content/videos",
|
||||
format: "md",
|
||||
fields: [
|
||||
{
|
||||
|
|
@ -162,6 +162,29 @@ export default defineConfig({
|
|||
label: "Date",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
name: "slug",
|
||||
label: "Slug",
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
name: "description",
|
||||
label: "Description",
|
||||
ui: {
|
||||
component: "textarea",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
name: "thumbnail",
|
||||
label: "Thumbnail URL",
|
||||
},
|
||||
{
|
||||
type: "boolean",
|
||||
name: "draft",
|
||||
label: "Draft",
|
||||
},
|
||||
]
|
||||
},
|
||||
],
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue