v5 migration + remove i18n
This commit is contained in:
parent
b7ce5b7f20
commit
b2b6887fdf
84 changed files with 1258 additions and 1354 deletions
48
.astro/collections/HPsections.schema.json
Normal file
48
.astro/collections/HPsections.schema.json
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"$ref": "#/definitions/HPsections",
|
||||
"definitions": {
|
||||
"HPsections": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"lang": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fr",
|
||||
"en"
|
||||
]
|
||||
},
|
||||
"uid": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"order": {
|
||||
"type": "number"
|
||||
},
|
||||
"quickTitle": {
|
||||
"type": "string"
|
||||
},
|
||||
"quickImage": {
|
||||
"type": "string"
|
||||
},
|
||||
"reference": {
|
||||
"type": "string"
|
||||
},
|
||||
"$schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"lang",
|
||||
"order"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
}
|
61
.astro/collections/articles.schema.json
Normal file
61
.astro/collections/articles.schema.json
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"$ref": "#/definitions/articles",
|
||||
"definitions": {
|
||||
"articles": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"subtitle": {
|
||||
"type": "string"
|
||||
},
|
||||
"lang": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fr",
|
||||
"en"
|
||||
]
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"permalink": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"code": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"draft": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"$schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"title",
|
||||
"subtitle",
|
||||
"lang",
|
||||
"tags",
|
||||
"type",
|
||||
"permalink",
|
||||
"createdAt"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
}
|
61
.astro/collections/fragments.schema.json
Normal file
61
.astro/collections/fragments.schema.json
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"$ref": "#/definitions/fragments",
|
||||
"definitions": {
|
||||
"fragments": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"subtitle": {
|
||||
"type": "string"
|
||||
},
|
||||
"lang": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fr",
|
||||
"en"
|
||||
]
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"permalink": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"code": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"draft": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"$schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"title",
|
||||
"subtitle",
|
||||
"lang",
|
||||
"tags",
|
||||
"type",
|
||||
"permalink",
|
||||
"createdAt"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
}
|
61
.astro/collections/references.schema.json
Normal file
61
.astro/collections/references.schema.json
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"$ref": "#/definitions/references",
|
||||
"definitions": {
|
||||
"references": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"subtitle": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"lang": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fr",
|
||||
"en"
|
||||
]
|
||||
},
|
||||
"permalink": {
|
||||
"type": "string"
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"code": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"draft": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"$schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"title",
|
||||
"subtitle",
|
||||
"url",
|
||||
"lang",
|
||||
"permalink",
|
||||
"tags",
|
||||
"createdAt"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
}
|
32
.astro/collections/veille.schema.json
Normal file
32
.astro/collections/veille.schema.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"$ref": "#/definitions/veille",
|
||||
"definitions": {
|
||||
"veille": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"lang": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"fr",
|
||||
"en"
|
||||
]
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"$schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"lang",
|
||||
"title"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
}
|
1
.astro/content-assets.mjs
Normal file
1
.astro/content-assets.mjs
Normal file
|
@ -0,0 +1 @@
|
|||
export default new Map();
|
18
.astro/content-modules.mjs
Normal file
18
.astro/content-modules.mjs
Normal file
|
@ -0,0 +1,18 @@
|
|||
|
||||
export default new Map([
|
||||
["src/content/articles/en/after-effects-expressions.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fafter-effects-expressions.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/sci-hub-blocage.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fsci-hub-blocage.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/the-day-I-jamd.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fthe-day-I-jamd.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/video-compression.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fvideo-compression.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/en/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Fen%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/en/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Fen%2Fsuper-cookies.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/buttons.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fbuttons.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/sci-hub-blocage.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fsci-hub-blocage.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fsuper-cookies.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/the-day-I-jamd.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fthe-day-I-jamd.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/en-after-effects-expressions.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fen-after-effects-expressions.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/en-sci-hub-blocage.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fen-sci-hub-blocage.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/en-the-day-I-jamd.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fen-the-day-I-jamd.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/en-video-compression.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fen-video-compression.mdx&astroContentModuleFlag=true")]]);
|
||||
|
206
.astro/content.d.ts
vendored
Normal file
206
.astro/content.d.ts
vendored
Normal file
|
@ -0,0 +1,206 @@
|
|||
declare module 'astro:content' {
|
||||
interface Render {
|
||||
'.mdx': Promise<{
|
||||
Content: import('astro').MarkdownInstance<{}>['Content'];
|
||||
headings: import('astro').MarkdownHeading[];
|
||||
remarkPluginFrontmatter: Record<string, any>;
|
||||
components: import('astro').MDXInstance<{}>['components'];
|
||||
}>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'astro:content' {
|
||||
export interface RenderResult {
|
||||
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
|
||||
headings: import('astro').MarkdownHeading[];
|
||||
remarkPluginFrontmatter: Record<string, any>;
|
||||
}
|
||||
interface Render {
|
||||
'.md': Promise<RenderResult>;
|
||||
}
|
||||
|
||||
export interface RenderedContent {
|
||||
html: string;
|
||||
metadata?: {
|
||||
imagePaths: Array<string>;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'astro:content' {
|
||||
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
|
||||
|
||||
export type CollectionKey = keyof AnyEntryMap;
|
||||
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
|
||||
|
||||
export type ContentCollectionKey = keyof ContentEntryMap;
|
||||
export type DataCollectionKey = keyof DataEntryMap;
|
||||
|
||||
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
|
||||
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
|
||||
ContentEntryMap[C]
|
||||
>['slug'];
|
||||
|
||||
/** @deprecated Use `getEntry` instead. */
|
||||
export function getEntryBySlug<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
>(
|
||||
collection: C,
|
||||
// Note that this has to accept a regular string too, for SSR
|
||||
entrySlug: E,
|
||||
): E extends ValidContentEntrySlug<C>
|
||||
? Promise<CollectionEntry<C>>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
|
||||
/** @deprecated Use `getEntry` instead. */
|
||||
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
|
||||
collection: C,
|
||||
entryId: E,
|
||||
): Promise<CollectionEntry<C>>;
|
||||
|
||||
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
|
||||
collection: C,
|
||||
filter?: (entry: CollectionEntry<C>) => entry is E,
|
||||
): Promise<E[]>;
|
||||
export function getCollection<C extends keyof AnyEntryMap>(
|
||||
collection: C,
|
||||
filter?: (entry: CollectionEntry<C>) => unknown,
|
||||
): Promise<CollectionEntry<C>[]>;
|
||||
|
||||
export function getEntry<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
>(entry: {
|
||||
collection: C;
|
||||
slug: E;
|
||||
}): E extends ValidContentEntrySlug<C>
|
||||
? Promise<CollectionEntry<C>>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof DataEntryMap,
|
||||
E extends keyof DataEntryMap[C] | (string & {}),
|
||||
>(entry: {
|
||||
collection: C;
|
||||
id: E;
|
||||
}): E extends keyof DataEntryMap[C]
|
||||
? Promise<DataEntryMap[C][E]>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
>(
|
||||
collection: C,
|
||||
slug: E,
|
||||
): E extends ValidContentEntrySlug<C>
|
||||
? Promise<CollectionEntry<C>>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof DataEntryMap,
|
||||
E extends keyof DataEntryMap[C] | (string & {}),
|
||||
>(
|
||||
collection: C,
|
||||
id: E,
|
||||
): E extends keyof DataEntryMap[C]
|
||||
? string extends keyof DataEntryMap[C]
|
||||
? Promise<DataEntryMap[C][E]> | undefined
|
||||
: Promise<DataEntryMap[C][E]>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
|
||||
/** Resolve an array of entry references from the same collection */
|
||||
export function getEntries<C extends keyof ContentEntryMap>(
|
||||
entries: {
|
||||
collection: C;
|
||||
slug: ValidContentEntrySlug<C>;
|
||||
}[],
|
||||
): Promise<CollectionEntry<C>[]>;
|
||||
export function getEntries<C extends keyof DataEntryMap>(
|
||||
entries: {
|
||||
collection: C;
|
||||
id: keyof DataEntryMap[C];
|
||||
}[],
|
||||
): Promise<CollectionEntry<C>[]>;
|
||||
|
||||
export function render<C extends keyof AnyEntryMap>(
|
||||
entry: AnyEntryMap[C][string],
|
||||
): Promise<RenderResult>;
|
||||
|
||||
export function reference<C extends keyof AnyEntryMap>(
|
||||
collection: C,
|
||||
): import('astro/zod').ZodEffects<
|
||||
import('astro/zod').ZodString,
|
||||
C extends keyof ContentEntryMap
|
||||
? {
|
||||
collection: C;
|
||||
slug: ValidContentEntrySlug<C>;
|
||||
}
|
||||
: {
|
||||
collection: C;
|
||||
id: keyof DataEntryMap[C];
|
||||
}
|
||||
>;
|
||||
// Allow generic `string` to avoid excessive type errors in the config
|
||||
// if `dev` is not running to update as you edit.
|
||||
// Invalid collection names will be caught at build time.
|
||||
export function reference<C extends string>(
|
||||
collection: C,
|
||||
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
|
||||
|
||||
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
|
||||
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
|
||||
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
|
||||
>;
|
||||
|
||||
type ContentEntryMap = {
|
||||
|
||||
};
|
||||
|
||||
type DataEntryMap = {
|
||||
"HPsections": Record<string, {
|
||||
id: string;
|
||||
body?: string;
|
||||
collection: "HPsections";
|
||||
data: InferEntrySchema<"HPsections">;
|
||||
rendered?: RenderedContent;
|
||||
filePath?: string;
|
||||
}>;
|
||||
"articles": Record<string, {
|
||||
id: string;
|
||||
body?: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">;
|
||||
rendered?: RenderedContent;
|
||||
filePath?: string;
|
||||
}>;
|
||||
"fragments": Record<string, {
|
||||
id: string;
|
||||
body?: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">;
|
||||
rendered?: RenderedContent;
|
||||
filePath?: string;
|
||||
}>;
|
||||
"references": Record<string, {
|
||||
id: string;
|
||||
body?: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">;
|
||||
rendered?: RenderedContent;
|
||||
filePath?: string;
|
||||
}>;
|
||||
"veille": Record<string, {
|
||||
id: string;
|
||||
body?: string;
|
||||
collection: "veille";
|
||||
data: InferEntrySchema<"veille">;
|
||||
rendered?: RenderedContent;
|
||||
filePath?: string;
|
||||
}>;
|
||||
|
||||
};
|
||||
|
||||
type AnyEntryMap = ContentEntryMap & DataEntryMap;
|
||||
|
||||
export type ContentConfig = typeof import("../src/content.config.js");
|
||||
}
|
1
.astro/data-store.json
Normal file
1
.astro/data-store.json
Normal file
File diff suppressed because one or more lines are too long
5
.astro/settings.json
Normal file
5
.astro/settings.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"_variables": {
|
||||
"lastUpdateCheck": 1735403503212
|
||||
}
|
||||
}
|
485
.astro/types.d.ts
vendored
485
.astro/types.d.ts
vendored
|
@ -1,483 +1,2 @@
|
|||
declare module 'astro:content' {
|
||||
interface Render {
|
||||
'.mdx': Promise<{
|
||||
Content: import('astro').MarkdownInstance<{}>['Content'];
|
||||
headings: import('astro').MarkdownHeading[];
|
||||
remarkPluginFrontmatter: Record<string, any>;
|
||||
}>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'astro:content' {
|
||||
interface Render {
|
||||
'.md': Promise<{
|
||||
Content: import('astro').MarkdownInstance<{}>['Content'];
|
||||
headings: import('astro').MarkdownHeading[];
|
||||
remarkPluginFrontmatter: Record<string, any>;
|
||||
}>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'astro:content' {
|
||||
export { z } from 'astro/zod';
|
||||
|
||||
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
|
||||
|
||||
export type CollectionKey = keyof AnyEntryMap;
|
||||
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
|
||||
|
||||
export type ContentCollectionKey = keyof ContentEntryMap;
|
||||
export type DataCollectionKey = keyof DataEntryMap;
|
||||
|
||||
// This needs to be in sync with ImageMetadata
|
||||
export type ImageFunction = () => import('astro/zod').ZodObject<{
|
||||
src: import('astro/zod').ZodString;
|
||||
width: import('astro/zod').ZodNumber;
|
||||
height: import('astro/zod').ZodNumber;
|
||||
format: import('astro/zod').ZodUnion<
|
||||
[
|
||||
import('astro/zod').ZodLiteral<'png'>,
|
||||
import('astro/zod').ZodLiteral<'jpg'>,
|
||||
import('astro/zod').ZodLiteral<'jpeg'>,
|
||||
import('astro/zod').ZodLiteral<'tiff'>,
|
||||
import('astro/zod').ZodLiteral<'webp'>,
|
||||
import('astro/zod').ZodLiteral<'gif'>,
|
||||
import('astro/zod').ZodLiteral<'svg'>,
|
||||
import('astro/zod').ZodLiteral<'avif'>,
|
||||
]
|
||||
>;
|
||||
}>;
|
||||
|
||||
type BaseSchemaWithoutEffects =
|
||||
| import('astro/zod').AnyZodObject
|
||||
| import('astro/zod').ZodUnion<[BaseSchemaWithoutEffects, ...BaseSchemaWithoutEffects[]]>
|
||||
| import('astro/zod').ZodDiscriminatedUnion<string, import('astro/zod').AnyZodObject[]>
|
||||
| import('astro/zod').ZodIntersection<BaseSchemaWithoutEffects, BaseSchemaWithoutEffects>;
|
||||
|
||||
type BaseSchema =
|
||||
| BaseSchemaWithoutEffects
|
||||
| import('astro/zod').ZodEffects<BaseSchemaWithoutEffects>;
|
||||
|
||||
export type SchemaContext = { image: ImageFunction };
|
||||
|
||||
type DataCollectionConfig<S extends BaseSchema> = {
|
||||
type: 'data';
|
||||
schema?: S | ((context: SchemaContext) => S);
|
||||
};
|
||||
|
||||
type ContentCollectionConfig<S extends BaseSchema> = {
|
||||
type?: 'content';
|
||||
schema?: S | ((context: SchemaContext) => S);
|
||||
};
|
||||
|
||||
type CollectionConfig<S> = ContentCollectionConfig<S> | DataCollectionConfig<S>;
|
||||
|
||||
export function defineCollection<S extends BaseSchema>(
|
||||
input: CollectionConfig<S>
|
||||
): CollectionConfig<S>;
|
||||
|
||||
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
|
||||
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
|
||||
ContentEntryMap[C]
|
||||
>['slug'];
|
||||
|
||||
export function getEntryBySlug<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
>(
|
||||
collection: C,
|
||||
// Note that this has to accept a regular string too, for SSR
|
||||
entrySlug: E
|
||||
): E extends ValidContentEntrySlug<C>
|
||||
? Promise<CollectionEntry<C>>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
|
||||
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
|
||||
collection: C,
|
||||
entryId: E
|
||||
): Promise<CollectionEntry<C>>;
|
||||
|
||||
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
|
||||
collection: C,
|
||||
filter?: (entry: CollectionEntry<C>) => entry is E
|
||||
): Promise<E[]>;
|
||||
export function getCollection<C extends keyof AnyEntryMap>(
|
||||
collection: C,
|
||||
filter?: (entry: CollectionEntry<C>) => unknown
|
||||
): Promise<CollectionEntry<C>[]>;
|
||||
|
||||
export function getEntry<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
>(entry: {
|
||||
collection: C;
|
||||
slug: E;
|
||||
}): E extends ValidContentEntrySlug<C>
|
||||
? Promise<CollectionEntry<C>>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof DataEntryMap,
|
||||
E extends keyof DataEntryMap[C] | (string & {}),
|
||||
>(entry: {
|
||||
collection: C;
|
||||
id: E;
|
||||
}): E extends keyof DataEntryMap[C]
|
||||
? Promise<DataEntryMap[C][E]>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
>(
|
||||
collection: C,
|
||||
slug: E
|
||||
): E extends ValidContentEntrySlug<C>
|
||||
? Promise<CollectionEntry<C>>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
export function getEntry<
|
||||
C extends keyof DataEntryMap,
|
||||
E extends keyof DataEntryMap[C] | (string & {}),
|
||||
>(
|
||||
collection: C,
|
||||
id: E
|
||||
): E extends keyof DataEntryMap[C]
|
||||
? Promise<DataEntryMap[C][E]>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
|
||||
/** Resolve an array of entry references from the same collection */
|
||||
export function getEntries<C extends keyof ContentEntryMap>(
|
||||
entries: {
|
||||
collection: C;
|
||||
slug: ValidContentEntrySlug<C>;
|
||||
}[]
|
||||
): Promise<CollectionEntry<C>[]>;
|
||||
export function getEntries<C extends keyof DataEntryMap>(
|
||||
entries: {
|
||||
collection: C;
|
||||
id: keyof DataEntryMap[C];
|
||||
}[]
|
||||
): Promise<CollectionEntry<C>[]>;
|
||||
|
||||
export function reference<C extends keyof AnyEntryMap>(
|
||||
collection: C
|
||||
): import('astro/zod').ZodEffects<
|
||||
import('astro/zod').ZodString,
|
||||
C extends keyof ContentEntryMap
|
||||
? {
|
||||
collection: C;
|
||||
slug: ValidContentEntrySlug<C>;
|
||||
}
|
||||
: {
|
||||
collection: C;
|
||||
id: keyof DataEntryMap[C];
|
||||
}
|
||||
>;
|
||||
// Allow generic `string` to avoid excessive type errors in the config
|
||||
// if `dev` is not running to update as you edit.
|
||||
// Invalid collection names will be caught at build time.
|
||||
export function reference<C extends string>(
|
||||
collection: C
|
||||
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
|
||||
|
||||
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
|
||||
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
|
||||
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
|
||||
>;
|
||||
|
||||
type ContentEntryMap = {
|
||||
"articles": {
|
||||
"en/2022.md": {
|
||||
id: "en/2022.md";
|
||||
slug: "en/2022";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/2023.md": {
|
||||
id: "en/2023.md";
|
||||
slug: "en/2023";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/after-effects-expressions.mdx": {
|
||||
id: "en/after-effects-expressions.mdx";
|
||||
slug: "en/after-effects-expressions";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"en/faq.md": {
|
||||
id: "en/faq.md";
|
||||
slug: "en/faq";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/gratuiste.md": {
|
||||
id: "en/gratuiste.md";
|
||||
slug: "en/gratuiste";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/sci-hub-blocage.mdx": {
|
||||
id: "en/sci-hub-blocage.mdx";
|
||||
slug: "en/sci-hub-blocage";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"en/the-day-I-jamd.mdx": {
|
||||
id: "en/the-day-I-jamd.mdx";
|
||||
slug: "en/the-day-i-jamd";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"en/video-compression.mdx": {
|
||||
id: "en/video-compression.mdx";
|
||||
slug: "en/video-compression";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"fr/2022.md": {
|
||||
id: "fr/2022.md";
|
||||
slug: "fr/2022";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/2023.md": {
|
||||
id: "fr/2023.md";
|
||||
slug: "fr/2023";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/after-effects-expressions.md": {
|
||||
id: "fr/after-effects-expressions.md";
|
||||
slug: "fr/after-effects-expressions";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/faq.md": {
|
||||
id: "fr/faq.md";
|
||||
slug: "fr/faq";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/gratuiste.md": {
|
||||
id: "fr/gratuiste.md";
|
||||
slug: "fr/gratuiste";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/sci-hub-blocage.mdx": {
|
||||
id: "fr/sci-hub-blocage.mdx";
|
||||
slug: "fr/sci-hub-blocage";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"fr/the-day-I-jamd.mdx": {
|
||||
id: "fr/the-day-I-jamd.mdx";
|
||||
slug: "fr/the-day-i-jamd";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"fr/video-compression.md": {
|
||||
id: "fr/video-compression.md";
|
||||
slug: "fr/video-compression";
|
||||
body: string;
|
||||
collection: "articles";
|
||||
data: InferEntrySchema<"articles">
|
||||
} & { render(): Render[".md"] };
|
||||
};
|
||||
"fragments": {
|
||||
"en/acme-sh-tls-cert.md": {
|
||||
id: "en/acme-sh-tls-cert.md";
|
||||
slug: "en/acme-sh-tls-cert";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/array-vs-array.md": {
|
||||
id: "en/array-vs-array.md";
|
||||
slug: "en/array-vs-array";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/buttons.md": {
|
||||
id: "en/buttons.md";
|
||||
slug: "en/buttons";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/image-full.mdx": {
|
||||
id: "en/image-full.mdx";
|
||||
slug: "en/image-full";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"en/nuxt-graphql-static.md": {
|
||||
id: "en/nuxt-graphql-static.md";
|
||||
slug: "en/nuxt-graphql-static";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/super-cookies.mdx": {
|
||||
id: "en/super-cookies.mdx";
|
||||
slug: "en/super-cookies";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"en/toulouse-fun.md": {
|
||||
id: "en/toulouse-fun.md";
|
||||
slug: "en/toulouse-fun";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/visited-links.md": {
|
||||
id: "en/visited-links.md";
|
||||
slug: "en/visited-links";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/acme-sh-tls-cert.md": {
|
||||
id: "fr/acme-sh-tls-cert.md";
|
||||
slug: "fr/acme-sh-tls-cert";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/array-vs-array.md": {
|
||||
id: "fr/array-vs-array.md";
|
||||
slug: "fr/array-vs-array";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/buttons.mdx": {
|
||||
id: "fr/buttons.mdx";
|
||||
slug: "fr/buttons";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"fr/image-full.mdx": {
|
||||
id: "fr/image-full.mdx";
|
||||
slug: "fr/image-full";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"fr/nuxt-graphql-static.md": {
|
||||
id: "fr/nuxt-graphql-static.md";
|
||||
slug: "fr/nuxt-graphql-static";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/super-cookies.mdx": {
|
||||
id: "fr/super-cookies.mdx";
|
||||
slug: "fr/super-cookies";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".mdx"] };
|
||||
"fr/toulouse-fun.md": {
|
||||
id: "fr/toulouse-fun.md";
|
||||
slug: "fr/toulouse-fun";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/visited-links.md": {
|
||||
id: "fr/visited-links.md";
|
||||
slug: "fr/visited-links";
|
||||
body: string;
|
||||
collection: "fragments";
|
||||
data: InferEntrySchema<"fragments">
|
||||
} & { render(): Render[".md"] };
|
||||
};
|
||||
"references": {
|
||||
"en/3w.md": {
|
||||
id: "en/3w.md";
|
||||
slug: "en/3w";
|
||||
body: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/natureo.md": {
|
||||
id: "en/natureo.md";
|
||||
slug: "en/natureo";
|
||||
body: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/parole-expression.md": {
|
||||
id: "en/parole-expression.md";
|
||||
slug: "en/parole-expression";
|
||||
body: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">
|
||||
} & { render(): Render[".md"] };
|
||||
"en/rose-primaire.md": {
|
||||
id: "en/rose-primaire.md";
|
||||
slug: "en/rose-primaire";
|
||||
body: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/3w.md": {
|
||||
id: "fr/3w.md";
|
||||
slug: "fr/3w";
|
||||
body: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/natureo.md": {
|
||||
id: "fr/natureo.md";
|
||||
slug: "fr/natureo";
|
||||
body: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/parole-expression.md": {
|
||||
id: "fr/parole-expression.md";
|
||||
slug: "fr/parole-expression";
|
||||
body: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">
|
||||
} & { render(): Render[".md"] };
|
||||
"fr/rose-primaire.md": {
|
||||
id: "fr/rose-primaire.md";
|
||||
slug: "fr/rose-primaire";
|
||||
body: string;
|
||||
collection: "references";
|
||||
data: InferEntrySchema<"references">
|
||||
} & { render(): Render[".md"] };
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
type DataEntryMap = {
|
||||
|
||||
};
|
||||
|
||||
type AnyEntryMap = ContentEntryMap & DataEntryMap;
|
||||
|
||||
type ContentConfig = typeof import("../src/content/config");
|
||||
}
|
||||
/// <reference types="astro/client" />
|
||||
/// <reference path="content.d.ts" />
|
Loading…
Add table
Add a link
Reference in a new issue