Skip to content

Commit 186cbcb

Browse files
committed
remove all parsemodules
1 parent 32192a3 commit 186cbcb

19 files changed

Lines changed: 145 additions & 94 deletions

File tree

‎apps/codingcatdev/src/routes/(content-list)/ContentCards.svelte‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22
import Image from '$lib/components/content/Image.svelte';
33
import type { Content, ContentType } from '$lib/types';
44
5-
export let data: { content: Content[]; next?: any };
5+
export let data: { contentType: ContentType; content: Content[]; next?: any };
66
77
let next = data.next;
8+
const contentType = data.contentType;
89
const more = async () => {
910
const response = await fetch('/api/more-content', {
1011
method: 'POST',
11-
body: JSON.stringify({ after: next }),
12+
body: JSON.stringify({ after: next, contentType }),
1213
headers: {
1314
'content-type': 'application/json'
1415
}
1516
});
1617
const d = await response.json();
1718
data = {
19+
contentType,
1820
content: [...data.content, ...d.content],
1921
next
2022
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Author } from '$lib/types';
33

4+
const contentType = ContentType.podcast;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Author>({
7-
contentItems: await getContentTypeDirectory<Author>(ContentType.author)
10+
contentItems: await getContentTypeDirectory<Author>(contentType)
811
})
912
};
1013
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Content } from '$lib/types';
33

4+
const contentType = ContentType.post;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Content>({
7-
contentItems: await getContentTypeDirectory<Content>(ContentType.post)
10+
contentItems: await getContentTypeDirectory<Content>(contentType)
811
})
912
};
1013
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Content } from '$lib/types';
33

4+
const contentType = ContentType.course;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Content>({
7-
contentItems: await getContentTypeDirectory<Content>(ContentType.course)
10+
contentItems: await getContentTypeDirectory<Content>(contentType)
811
})
912
};
1013
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Content } from '$lib/types';
33

4+
const contentType = ContentType.framework;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Content>({
7-
contentItems: await getContentTypeDirectory<Content>(ContentType.framework)
10+
contentItems: await getContentTypeDirectory<Content>(contentType)
811
})
912
};
1013
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Author } from '$lib/types';
33

4+
const contentType = ContentType.guest;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Author>({
7-
contentItems: await getContentTypeDirectory<Author>(ContentType.guest)
10+
contentItems: await getContentTypeDirectory<Author>(contentType)
811
})
912
};
1013
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Content } from '$lib/types';
33

4+
const contentType = ContentType.language;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Content>({
7-
contentItems: await getContentTypeDirectory<Content>(ContentType.language)
10+
contentItems: await getContentTypeDirectory<Content>(contentType)
811
})
912
};
1013
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Content } from '$lib/types';
33

4+
const contentType = ContentType.podcast;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Content>({
7-
contentItems: await getContentTypeDirectory<Content>(ContentType.podcast)
10+
contentItems: await getContentTypeDirectory<Content>(contentType)
811
})
912
};
1013
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Content } from '$lib/types';
33

4+
const contentType = ContentType.schedule;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Content>({
7-
contentItems: await getContentTypeDirectory<Content>(ContentType.schedule)
10+
contentItems: await getContentTypeDirectory<Content>(contentType)
811
})
912
};
1013
};
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { getContentTypeDirectory, listContent } from '$lib/server/content';
22
import { ContentType, type Sponsor } from '$lib/types';
33

4+
const contentType = ContentType.sponsor;
5+
46
export const load = async () => {
57
return {
8+
contentType,
69
...await listContent<Sponsor>({
7-
contentItems: await getContentTypeDirectory<Sponsor>(ContentType.sponsor)
10+
contentItems: await getContentTypeDirectory<Sponsor>(contentType)
811
})
912
};
1013
};

0 commit comments

Comments
 (0)