Skip to content

Commit 9719b03

Browse files
author
huseinkntrc
committed
refine portfolio design and content
1 parent b3c3739 commit 9719b03

24 files changed

Lines changed: 3964 additions & 3385 deletions

.astro/content.d.ts

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
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+
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
20+
21+
export type CollectionKey = keyof DataEntryMap;
22+
export type CollectionEntry<C extends CollectionKey> = Flatten<DataEntryMap[C]>;
23+
24+
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
25+
26+
export type ReferenceDataEntry<
27+
C extends CollectionKey,
28+
E extends keyof DataEntryMap[C] = string,
29+
> = {
30+
collection: C;
31+
id: E;
32+
};
33+
34+
export type ReferenceLiveEntry<C extends keyof LiveContentConfig['collections']> = {
35+
collection: C;
36+
id: string;
37+
};
38+
39+
export function getCollection<C extends keyof DataEntryMap, E extends CollectionEntry<C>>(
40+
collection: C,
41+
filter?: (entry: CollectionEntry<C>) => entry is E,
42+
): Promise<E[]>;
43+
export function getCollection<C extends keyof DataEntryMap>(
44+
collection: C,
45+
filter?: (entry: CollectionEntry<C>) => unknown,
46+
): Promise<CollectionEntry<C>[]>;
47+
48+
export function getLiveCollection<C extends keyof LiveContentConfig['collections']>(
49+
collection: C,
50+
filter?: LiveLoaderCollectionFilterType<C>,
51+
): Promise<
52+
import('astro').LiveDataCollectionResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>
53+
>;
54+
55+
export function getEntry<
56+
C extends keyof DataEntryMap,
57+
E extends keyof DataEntryMap[C] | (string & {}),
58+
>(
59+
entry: ReferenceDataEntry<C, E>,
60+
): E extends keyof DataEntryMap[C]
61+
? Promise<DataEntryMap[C][E]>
62+
: Promise<CollectionEntry<C> | undefined>;
63+
export function getEntry<
64+
C extends keyof DataEntryMap,
65+
E extends keyof DataEntryMap[C] | (string & {}),
66+
>(
67+
collection: C,
68+
id: E,
69+
): E extends keyof DataEntryMap[C]
70+
? string extends keyof DataEntryMap[C]
71+
? Promise<DataEntryMap[C][E]> | undefined
72+
: Promise<DataEntryMap[C][E]>
73+
: Promise<CollectionEntry<C> | undefined>;
74+
export function getLiveEntry<C extends keyof LiveContentConfig['collections']>(
75+
collection: C,
76+
filter: string | LiveLoaderEntryFilterType<C>,
77+
): Promise<import('astro').LiveDataEntryResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>>;
78+
79+
/** Resolve an array of entry references from the same collection */
80+
export function getEntries<C extends keyof DataEntryMap>(
81+
entries: ReferenceDataEntry<C, keyof DataEntryMap[C]>[],
82+
): Promise<CollectionEntry<C>[]>;
83+
84+
export function render<C extends keyof DataEntryMap>(
85+
entry: DataEntryMap[C][string],
86+
): Promise<RenderResult>;
87+
88+
export function reference<
89+
C extends
90+
| keyof DataEntryMap
91+
// Allow generic `string` to avoid excessive type errors in the config
92+
// if `dev` is not running to update as you edit.
93+
// Invalid collection names will be caught at build time.
94+
| (string & {}),
95+
>(
96+
collection: C,
97+
): import('astro/zod').ZodPipe<
98+
import('astro/zod').ZodString,
99+
import('astro/zod').ZodTransform<
100+
C extends keyof DataEntryMap
101+
? {
102+
collection: C;
103+
id: string;
104+
}
105+
: never,
106+
string
107+
>
108+
>;
109+
110+
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
111+
type InferEntrySchema<C extends keyof DataEntryMap> = import('astro/zod').infer<
112+
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
113+
>;
114+
type ExtractLoaderConfig<T> = T extends { loader: infer L } ? L : never;
115+
type InferLoaderSchema<
116+
C extends keyof DataEntryMap,
117+
L = ExtractLoaderConfig<ContentConfig['collections'][C]>,
118+
> = L extends { schema: import('astro/zod').ZodSchema }
119+
? import('astro/zod').infer<L['schema']>
120+
: any;
121+
122+
type DataEntryMap = {
123+
124+
};
125+
126+
type ExtractLoaderTypes<T> = T extends import('astro/loaders').LiveLoader<
127+
infer TData,
128+
infer TEntryFilter,
129+
infer TCollectionFilter,
130+
infer TError
131+
>
132+
? { data: TData; entryFilter: TEntryFilter; collectionFilter: TCollectionFilter; error: TError }
133+
: { data: never; entryFilter: never; collectionFilter: never; error: never };
134+
type ExtractEntryFilterType<T> = ExtractLoaderTypes<T>['entryFilter'];
135+
type ExtractCollectionFilterType<T> = ExtractLoaderTypes<T>['collectionFilter'];
136+
type ExtractErrorType<T> = ExtractLoaderTypes<T>['error'];
137+
138+
type LiveLoaderDataType<C extends keyof LiveContentConfig['collections']> =
139+
LiveContentConfig['collections'][C]['schema'] extends undefined
140+
? ExtractDataType<LiveContentConfig['collections'][C]['loader']>
141+
: import('astro/zod').infer<
142+
Exclude<LiveContentConfig['collections'][C]['schema'], undefined>
143+
>;
144+
type LiveLoaderEntryFilterType<C extends keyof LiveContentConfig['collections']> =
145+
ExtractEntryFilterType<LiveContentConfig['collections'][C]['loader']>;
146+
type LiveLoaderCollectionFilterType<C extends keyof LiveContentConfig['collections']> =
147+
ExtractCollectionFilterType<LiveContentConfig['collections'][C]['loader']>;
148+
type LiveLoaderErrorType<C extends keyof LiveContentConfig['collections']> = ExtractErrorType<
149+
LiveContentConfig['collections'][C]['loader']
150+
>;
151+
152+
export type ContentConfig = never;
153+
export type LiveContentConfig = never;
154+
}

.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": 1731962339065
3+
"lastUpdateCheck": 1774655691381
44
}
55
}

.astro/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/// <reference types="astro/client" />
2+
/// <reference path="content.d.ts" />

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
- name: Install, build, and upload your site output
2424
uses: withastro/action@v2
2525
with:
26-
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
26+
package-manager: pnpm@9 # Keep CI aligned with the current lockfile format.
2727
# path: . # The root location of your Astro project inside the repository. (optional)
28-
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
28+
node-version: 22 # Match the local runtime used for Astro 6 / Tailwind 4 upgrades.
2929

3030
deploy:
3131
needs: build

astro.config.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import { defineConfig } from 'astro/config'
22

33
// https://astro.build/config
4-
import tailwind from '@astrojs/tailwind'
54
import partytown from '@astrojs/partytown'
5+
import tailwindcss from '@tailwindcss/vite'
66

77
// https://astro.build/config
88
export default defineConfig({
99
integrations: [
10-
tailwind(),
1110
partytown({
1211
// Adds dataLayer.push as a forwarding-event.
1312
config: {
1413
forward: ['dataLayer.push'],
1514
},
1615
}),
1716
],
17+
vite: {
18+
plugins: [tailwindcss()],
19+
},
1820
site: 'https://huseink.dev',
1921
markdown: {
2022
syntaxHighlight: 'prism',

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14-
"@astrojs/check": "^0.9.4",
15-
"@astrojs/partytown": "^2.1.2",
16-
"@astrojs/tailwind": "^5.1.2",
17-
"@tailwindcss/typography": "^0.5.15",
18-
"@types/node": "^22.9.0",
19-
"astro": "^4.16.13",
20-
"prettier": "^3.3.3",
14+
"@astrojs/check": "^0.9.8",
15+
"@astrojs/partytown": "^2.1.6",
16+
"@tailwindcss/typography": "^0.5.19",
17+
"@types/node": "^25.5.0",
18+
"astro": "^6.1.1",
19+
"prettier": "^3.8.1",
2120
"prettier-plugin-astro": "^0.14.1",
22-
"tailwindcss": "^3.4.15",
23-
"typescript": "^5.6.3"
21+
"tailwindcss": "^4.2.2",
22+
"typescript": "^5.9.3"
23+
},
24+
"devDependencies": {
25+
"@tailwindcss/vite": "^4.2.2"
2426
}
2527
}

0 commit comments

Comments
 (0)