Skip to content

Commit 6bdcfc5

Browse files
committed
Minor changes
1 parent 9e42ae6 commit 6bdcfc5

5 files changed

Lines changed: 49 additions & 4 deletions

File tree

.astro/content.d.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ declare module 'astro:content' {
4545
collection: C;
4646
slug: E;
4747
};
48+
export type ReferenceLiveEntry<C extends keyof LiveContentConfig['collections']> = {
49+
collection: C;
50+
id: string;
51+
};
4852

4953
/** @deprecated Use `getEntry` instead. */
5054
export function getEntryBySlug<
@@ -73,6 +77,13 @@ declare module 'astro:content' {
7377
filter?: (entry: CollectionEntry<C>) => unknown,
7478
): Promise<CollectionEntry<C>[]>;
7579

80+
export function getLiveCollection<C extends keyof LiveContentConfig['collections']>(
81+
collection: C,
82+
filter?: LiveLoaderCollectionFilterType<C>,
83+
): Promise<
84+
import('astro').LiveDataCollectionResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>
85+
>;
86+
7687
export function getEntry<
7788
C extends keyof ContentEntryMap,
7889
E extends ValidContentEntrySlug<C> | (string & {}),
@@ -109,6 +120,10 @@ declare module 'astro:content' {
109120
? Promise<DataEntryMap[C][E]> | undefined
110121
: Promise<DataEntryMap[C][E]>
111122
: Promise<CollectionEntry<C> | undefined>;
123+
export function getLiveEntry<C extends keyof LiveContentConfig['collections']>(
124+
collection: C,
125+
filter: string | LiveLoaderEntryFilterType<C>,
126+
): Promise<import('astro').LiveDataEntryResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>>;
112127

113128
/** Resolve an array of entry references from the same collection */
114129
export function getEntries<C extends keyof ContentEntryMap>(
@@ -162,5 +177,33 @@ declare module 'astro:content' {
162177

163178
type AnyEntryMap = ContentEntryMap & DataEntryMap;
164179

180+
type ExtractLoaderTypes<T> = T extends import('astro/loaders').LiveLoader<
181+
infer TData,
182+
infer TEntryFilter,
183+
infer TCollectionFilter,
184+
infer TError
185+
>
186+
? { data: TData; entryFilter: TEntryFilter; collectionFilter: TCollectionFilter; error: TError }
187+
: { data: never; entryFilter: never; collectionFilter: never; error: never };
188+
type ExtractDataType<T> = ExtractLoaderTypes<T>['data'];
189+
type ExtractEntryFilterType<T> = ExtractLoaderTypes<T>['entryFilter'];
190+
type ExtractCollectionFilterType<T> = ExtractLoaderTypes<T>['collectionFilter'];
191+
type ExtractErrorType<T> = ExtractLoaderTypes<T>['error'];
192+
193+
type LiveLoaderDataType<C extends keyof LiveContentConfig['collections']> =
194+
LiveContentConfig['collections'][C]['schema'] extends undefined
195+
? ExtractDataType<LiveContentConfig['collections'][C]['loader']>
196+
: import('astro/zod').infer<
197+
Exclude<LiveContentConfig['collections'][C]['schema'], undefined>
198+
>;
199+
type LiveLoaderEntryFilterType<C extends keyof LiveContentConfig['collections']> =
200+
ExtractEntryFilterType<LiveContentConfig['collections'][C]['loader']>;
201+
type LiveLoaderCollectionFilterType<C extends keyof LiveContentConfig['collections']> =
202+
ExtractCollectionFilterType<LiveContentConfig['collections'][C]['loader']>;
203+
type LiveLoaderErrorType<C extends keyof LiveContentConfig['collections']> = ExtractErrorType<
204+
LiveContentConfig['collections'][C]['loader']
205+
>;
206+
165207
export type ContentConfig = typeof import("../src/content/config.js");
208+
export type LiveContentConfig = never;
166209
}

.astro/data-store.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/components/Footer.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const endCopyYear = new Date().getFullYear() + 2;
1313
<p>&copy; {currentYear} - {endCopyYear} Abdon Morales.</p>
1414
</div>
1515
<p class="socials">
16-
<a href="https://x.com/AbdonMorales7"> Twitter</a>
16+
<!--<a href="https://x.com/AbdonMorales7"> Twitter</a>-->
1717
<a href="https://github.com/abdonmorales"> GitHub</a>
18-
<a href="https://gitlab.com/abdonmorales"> Gitlab</a>
18+
<a href="https://gitlab.com/abdonmorales"> GitLab</a>
1919
</p>
2020
</footer>
2121
<style>

src/components/Nav.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const textLinks: { label: string; href: string }[] = [
1414
1515
/** Icon links to social media — edit these with links to your profiles! */
1616
const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[] = [
17-
{ label: 'Twitter', href: 'https://x.com/AbdonMorales7', icon: 'twitter-logo' },
17+
/**{ label: 'Twitter', href: 'https://x.com/AbdonMorales7', icon: 'twitter-logo' },*/
1818
{ label: 'GitHub', href: 'https://github.com/abdonmorales', icon: 'github-logo' },
1919
{ label: 'GitLab', href: 'https://gitlab.com/abdonmorales', icon: 'gitlab-logo'},
2020
{ label: 'LinkedIn', href: 'https://www.linkedin.com/in/abdonmorales/', icon: 'linkedin-logo' },

src/components/SEO.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ const robots = `${noindex ? 'noindex' : 'index'}, ${nofollow ? 'nofollow' : 'fol
4040
<meta property="og:locale" content="en_US" />
4141

4242
<!-- Twitter -->
43+
<!--
4344
<meta name="twitter:card" content="summary_large_image" />
4445
<meta name="twitter:site" content="@AbdonMorales7" />
4546
<meta name="twitter:title" content={formattedContentTitle} />
4647
<meta name="twitter:description" content={description} />
4748
<meta name="twitter:image" content={imageURL} />
49+
-->

0 commit comments

Comments
 (0)