Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
icekylin committed Feb 6, 2024
1 parent 9570c35 commit 966cce9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/lib/component/Categories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
</script>

<div>
{#each categories as category}
{#each categories as category, i}
<a href="/" class="hover:underline">{category}</a>
{#if i !== categories.length - 1}>&nbsp;{/if}
{/each}
</div>
4 changes: 2 additions & 2 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type Post = {
date: string;
img?: string;
modified?: string;
categories?: string[];
tags?: string[];
categories: string[];
tags: string[];
published: boolean;
};
1 change: 1 addition & 0 deletions src/posts/hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: 你好世界
description: 这是迁移到 SvelteKit 的第一篇文章
date: '2024-2-5'
categories: [生活]
tags: [SvelteKit, Svelte]
published: true
---
Expand Down
2 changes: 2 additions & 0 deletions src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const prerender = true;

import type { Post } from '$lib/types';

export async function load({ fetch }) {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import { formatDate, getDate, getRelativeTimeDifference } from '$lib/utils';
import Layout from '$lib/layout.svelte';
import Dot from '$lib/component/Dot.svelte';
import Categories from '$lib/component/Categories.svelte';
import Tags from '$lib/component/Tags.svelte';
import { onMount } from 'svelte';
import Categories from '$lib/component/Categories.svelte';
export let data;
Expand Down

0 comments on commit 966cce9

Please sign in to comment.