Skip to content

Commit abddcc1

Browse files
fixed table of contents not displaying
1 parent dab5a1d commit abddcc1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/lib/components/Post.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{/if}
4242

4343
<TableOfContent {tableOfContent} />
44-
44+
4545
{#each blocks as block}
4646
<div class="my-4">
4747
<Block {block} />

src/lib/components/TableOfContent.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<script lang="ts">
22
import type { TableOfContentItems } from "$lib/types";
33
export let tableOfContent: (TableOfContentItems | undefined)[] | undefined;
4-
54
</script>
65

7-
{#if tableOfContent && tableOfContent.length > 0 && !tableOfContent?.some((s)=> s==null)}
6+
{#if tableOfContent && tableOfContent?.length > 0}
87
<ul class="bg-slate-100 rounded-md w-full py-6 list-none">
98
{#each tableOfContent as content }
109
{#if content}

0 commit comments

Comments
 (0)