-
+
+
-
+
-
+
+ {#if showToc}
+
+ {/if}
+
+
+
diff --git a/src/lib/components/TocTree.svelte b/src/lib/components/TocTree.svelte
index 3d0993897d..75431ed6a8 100644
--- a/src/lib/components/TocTree.svelte
+++ b/src/lib/components/TocTree.svelte
@@ -7,6 +7,8 @@
export let item: TableOfContentsElements['item'];
export let level = 1;
+ export let showToc = true;
+
const {
toc: {
helpers: { isActive }
@@ -22,6 +24,7 @@
class:is-selected={$isActive(heading.id)}
href="#{heading.id}"
use:melt={$item(heading.id)}
+ on:click|preventDefault={() => showToc = !showToc}
>
{@html heading.node.innerHTML}
diff --git a/src/lib/utils/tutorials.ts b/src/lib/utils/tutorials.ts
index 458df37cdb..e3a2d2965c 100644
--- a/src/lib/utils/tutorials.ts
+++ b/src/lib/utils/tutorials.ts
@@ -3,7 +3,7 @@ import type { Tutorial } from '$markdoc/layouts/Tutorial.svelte';
export function globToTutorial(data: { tutorials: Record
; pathname: string }) {
let isFound = false;
- let difficulty, readtime;
+ let difficulty: string | undefined, readtime: string | undefined;
return Object.entries(data.tutorials)
.map(([filepath, tutorial]) => {
diff --git a/src/markdoc/layouts/Policy.svelte b/src/markdoc/layouts/Policy.svelte
index 814e88e50e..a65ec86cbb 100644
--- a/src/markdoc/layouts/Policy.svelte
+++ b/src/markdoc/layouts/Policy.svelte
@@ -72,23 +72,14 @@
-
-
+
+
+
-