Skip to content

Commit 2cc6f82

Browse files
committed
fix: build 오류 수정
1 parent 9c7fd7a commit 2cc6f82

File tree

11 files changed

+16
-72
lines changed

11 files changed

+16
-72
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.
File renamed without changes.

src/posts/second-post.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ published: true
1212

1313
Media inside the **static** folder is served from `/`.
1414

15-
![Svelte](favicon.png)
15+
![Svelte](test.png)

src/routes/+page.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Post } from '$lib/types';
1+
import type { Post } from '$lib/types/post';
22

33
export async function load({ fetch }) {
44
const response = await fetch('/api/posts');

src/routes/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import * as config from '$lib/config';
44
55
let { data } = $props();
6+
console.log(data);
67
</script>
78

89
<svelte:head>

src/routes/about/+page.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<section class="container">
2+
<h1 class="title">About</h1>
3+
<p class="description">This is About Page of SvelteKit!</p>
4+
</section>

src/routes/api/posts/+server.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { json } from '@sveltejs/kit';
2-
import type { Post } from '$lib/types';
2+
import type { Post } from '$lib/types/post';
33

44
async function getPosts() {
55
let posts: Post[] = [];
@@ -15,9 +15,7 @@ async function getPosts() {
1515
}
1616
}
1717

18-
posts = posts.sort(
19-
(first, second) => new Date(second.date).getTime() - new Date(first.date).getTime()
20-
);
18+
posts = posts.sort(byDescendingDate);
2119

2220
return posts;
2321
}
@@ -26,3 +24,7 @@ export async function GET() {
2624
const posts = await getPosts();
2725
return json(posts);
2826
}
27+
28+
const byDescendingDate = (firstPost: Post, secondPost: Post) => {
29+
return new Date(secondPost.date).getTime() - new Date(firstPost.date).getTime();
30+
};

src/routes/header.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
<li>
1313
<a href="/about">About</a>
1414
</li>
15-
<li>
16-
<a href="/tech">Tech</a>
17-
</li>
1815
<li>
1916
<a href="/rss.xml" target="_blank">RSS</a>
2017
</li>

src/routes/rss.xml/+server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as config from '$lib/config';
2-
import type { Post } from '$lib/types';
3-
export const prerender = true;
2+
import type { Post } from '$lib/types/post';
43

54
export async function GET({ fetch }) {
65
const response = await fetch('/api/posts');

static/test.png

1.49 KB
Loading

0 commit comments

Comments
 (0)