Skip to content

Commit 8fa2d48

Browse files
authored
Merge pull request #25 from jonaspm/dev
Added youtube, dependencies upgrade, rearranged sections
2 parents 55d569f + 397ec52 commit 8fa2d48

27 files changed

+1525
-300
lines changed

.astro/content-assets.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default new Map();

.astro/content-modules.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default new Map();

.astro/content.d.ts

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
declare module 'astro:content' {
2+
export interface RenderResult {
3+
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
4+
headings: import('astro').MarkdownHeading[];
5+
remarkPluginFrontmatter: Record<string, any>;
6+
}
7+
interface Render {
8+
'.md': Promise<RenderResult>;
9+
}
10+
11+
export interface RenderedContent {
12+
html: string;
13+
metadata?: {
14+
imagePaths: Array<string>;
15+
[key: string]: unknown;
16+
};
17+
}
18+
}
19+
20+
declare module 'astro:content' {
21+
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
22+
23+
export type CollectionKey = keyof AnyEntryMap;
24+
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
25+
26+
export type ContentCollectionKey = keyof ContentEntryMap;
27+
export type DataCollectionKey = keyof DataEntryMap;
28+
29+
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
30+
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
31+
ContentEntryMap[C]
32+
>['slug'];
33+
34+
export type ReferenceDataEntry<
35+
C extends CollectionKey,
36+
E extends keyof DataEntryMap[C] = string,
37+
> = {
38+
collection: C;
39+
id: E;
40+
};
41+
export type ReferenceContentEntry<
42+
C extends keyof ContentEntryMap,
43+
E extends ValidContentEntrySlug<C> | (string & {}) = string,
44+
> = {
45+
collection: C;
46+
slug: E;
47+
};
48+
49+
/** @deprecated Use `getEntry` instead. */
50+
export function getEntryBySlug<
51+
C extends keyof ContentEntryMap,
52+
E extends ValidContentEntrySlug<C> | (string & {}),
53+
>(
54+
collection: C,
55+
// Note that this has to accept a regular string too, for SSR
56+
entrySlug: E,
57+
): E extends ValidContentEntrySlug<C>
58+
? Promise<CollectionEntry<C>>
59+
: Promise<CollectionEntry<C> | undefined>;
60+
61+
/** @deprecated Use `getEntry` instead. */
62+
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
63+
collection: C,
64+
entryId: E,
65+
): Promise<CollectionEntry<C>>;
66+
67+
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
68+
collection: C,
69+
filter?: (entry: CollectionEntry<C>) => entry is E,
70+
): Promise<E[]>;
71+
export function getCollection<C extends keyof AnyEntryMap>(
72+
collection: C,
73+
filter?: (entry: CollectionEntry<C>) => unknown,
74+
): Promise<CollectionEntry<C>[]>;
75+
76+
export function getEntry<
77+
C extends keyof ContentEntryMap,
78+
E extends ValidContentEntrySlug<C> | (string & {}),
79+
>(
80+
entry: ReferenceContentEntry<C, E>,
81+
): E extends ValidContentEntrySlug<C>
82+
? Promise<CollectionEntry<C>>
83+
: Promise<CollectionEntry<C> | undefined>;
84+
export function getEntry<
85+
C extends keyof DataEntryMap,
86+
E extends keyof DataEntryMap[C] | (string & {}),
87+
>(
88+
entry: ReferenceDataEntry<C, E>,
89+
): E extends keyof DataEntryMap[C]
90+
? Promise<DataEntryMap[C][E]>
91+
: Promise<CollectionEntry<C> | undefined>;
92+
export function getEntry<
93+
C extends keyof ContentEntryMap,
94+
E extends ValidContentEntrySlug<C> | (string & {}),
95+
>(
96+
collection: C,
97+
slug: E,
98+
): E extends ValidContentEntrySlug<C>
99+
? Promise<CollectionEntry<C>>
100+
: Promise<CollectionEntry<C> | undefined>;
101+
export function getEntry<
102+
C extends keyof DataEntryMap,
103+
E extends keyof DataEntryMap[C] | (string & {}),
104+
>(
105+
collection: C,
106+
id: E,
107+
): E extends keyof DataEntryMap[C]
108+
? string extends keyof DataEntryMap[C]
109+
? Promise<DataEntryMap[C][E]> | undefined
110+
: Promise<DataEntryMap[C][E]>
111+
: Promise<CollectionEntry<C> | undefined>;
112+
113+
/** Resolve an array of entry references from the same collection */
114+
export function getEntries<C extends keyof ContentEntryMap>(
115+
entries: ReferenceContentEntry<C, ValidContentEntrySlug<C>>[],
116+
): Promise<CollectionEntry<C>[]>;
117+
export function getEntries<C extends keyof DataEntryMap>(
118+
entries: ReferenceDataEntry<C, keyof DataEntryMap[C]>[],
119+
): Promise<CollectionEntry<C>[]>;
120+
121+
export function render<C extends keyof AnyEntryMap>(
122+
entry: AnyEntryMap[C][string],
123+
): Promise<RenderResult>;
124+
125+
export function reference<C extends keyof AnyEntryMap>(
126+
collection: C,
127+
): import('astro/zod').ZodEffects<
128+
import('astro/zod').ZodString,
129+
C extends keyof ContentEntryMap
130+
? ReferenceContentEntry<C, ValidContentEntrySlug<C>>
131+
: ReferenceDataEntry<C, keyof DataEntryMap[C]>
132+
>;
133+
// Allow generic `string` to avoid excessive type errors in the config
134+
// if `dev` is not running to update as you edit.
135+
// Invalid collection names will be caught at build time.
136+
export function reference<C extends string>(
137+
collection: C,
138+
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
139+
140+
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
141+
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
142+
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
143+
>;
144+
145+
type ContentEntryMap = {
146+
147+
};
148+
149+
type DataEntryMap = {
150+
151+
};
152+
153+
type AnyEntryMap = ContentEntryMap & DataEntryMap;
154+
155+
export type ContentConfig = typeof import("./../src/content.config.mjs");
156+
}

.astro/data-store.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[["Map",1,2],"meta::meta",["Map",3,4,5,6],"astro-version","5.4.2","astro-config-digest","{\"root\":{},\"srcDir\":{},\"publicDir\":{},\"outDir\":{},\"cacheDir\":{},\"site\":\"https://jonaspm.github.io\",\"compressHTML\":true,\"base\":\"/\",\"trailingSlash\":\"ignore\",\"output\":\"static\",\"scopedStyleStrategy\":\"attribute\",\"build\":{\"format\":\"directory\",\"client\":{},\"server\":{},\"assets\":\"_astro\",\"serverEntry\":\"entry.mjs\",\"redirects\":true,\"inlineStylesheets\":\"auto\",\"concurrency\":1},\"server\":{\"open\":false,\"host\":true,\"port\":3434,\"streaming\":true,\"allowedHosts\":[]},\"redirects\":{},\"image\":{\"endpoint\":{\"route\":\"/_image\"},\"service\":{\"entrypoint\":\"astro/assets/services/sharp\",\"config\":{}},\"domains\":[],\"remotePatterns\":[]},\"devToolbar\":{\"enabled\":true},\"markdown\":{\"syntaxHighlight\":\"shiki\",\"shikiConfig\":{\"langs\":[],\"langAlias\":{},\"theme\":\"github-dark\",\"themes\":{},\"wrap\":false,\"transformers\":[]},\"remarkPlugins\":[],\"rehypePlugins\":[],\"remarkRehype\":{},\"gfm\":true,\"smartypants\":true},\"security\":{\"checkOrigin\":true},\"env\":{\"schema\":{},\"validateSecrets\":false},\"experimental\":{\"clientPrerender\":false,\"contentIntellisense\":false,\"responsiveImages\":false,\"serializeConfig\":false},\"legacy\":{\"collections\":false}}"]

.astro/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"_variables": {
3-
"lastUpdateCheck": 1724430489753
3+
"lastUpdateCheck": 1741371622149
44
}
55
}

astro.config.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import { defineConfig } from "astro/config";
2-
import tailwind from "@astrojs/tailwind";
2+
import tailwindcss from '@tailwindcss/vite';
3+
4+
import react from "@astrojs/react";
35

46
// https://astro.build/config
57
export default defineConfig({
68
site: "https://jonaspm.github.io",
7-
integrations: [tailwind()],
9+
integrations: [react()],
810
server: {
9-
host: true
11+
host: true,
12+
port: 3434
1013
},
11-
experimental: {
12-
serverIslands: true
14+
vite: {
15+
plugins: [tailwindcss()]
1316
}
1417
});

0 commit comments

Comments
 (0)