Skip to content

Commit 3dab67e

Browse files
committed
Add conditional rendering for edit link and remove style to hide it
1 parent 5d84279 commit 3dab67e

3 files changed

Lines changed: 14 additions & 18 deletions

File tree

docs/src/routes/docs/+layout.svelte

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,18 @@
201201

202202
{@render children()}
203203

204-
<div>
205-
<a
206-
href="https://github.com/techniq/layerchart/blob/main/docs{page.url.pathname}.md"
207-
class="text-surface-content/50 hover:text-surface-content mb-4 mt-16 inline-flex items-center gap-1 text-sm"
208-
target="_blank"
209-
>
210-
<LucideFilePen class="inline-block h-4 w-4" />
211-
Edit this page
212-
</a>
213-
</div>
204+
{#if !page.data.meta?.hideEditLink}
205+
<div>
206+
<a
207+
href="https://github.com/techniq/layerchart/blob/main/docs{page.url.pathname}.md"
208+
class="text-surface-content/50 hover:text-surface-content mb-4 mt-16 inline-flex items-center gap-1 text-sm"
209+
target="_blank"
210+
>
211+
<LucideFilePen class="inline-block h-4 w-4" />
212+
Edit this page
213+
</a>
214+
</div>
215+
{/if}
214216

215217
<div class="flex gap-4">
216218
<!-- {#if pageContent.prev}

docs/src/routes/docs/playground/+page.svelte

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,3 @@
556556
</Pane>
557557
</PaneGroup>
558558
</div>
559-
560-
<style>
561-
/* Hide "Edit this page" */
562-
:global(div:has(> a[href*='/github'])) {
563-
display: none;
564-
}
565-
</style>

docs/src/routes/docs/playground/+page.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ export const load = async ({ data }) => {
22
return {
33
...data,
44
meta: {
5-
fullWidth: true
5+
fullWidth: true,
6+
hideEditLink: true
67
}
78
};
89
};

0 commit comments

Comments
 (0)