Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/demo/src/lib/tags/CTA.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { resolve } from '$app/paths';
interface Props {
children?: import('svelte').Snippet;
}
Expand All @@ -13,7 +14,9 @@
{@render children?.()}
<ul class="p-inline-list u-no-margin--bottom">
<li class="p-inline-list__item">
<a href="/documentation" class="p-button--positive u-no-margin--bottom">Get started</a>
<a href={resolve('/documentation')} class="p-button--positive u-no-margin--bottom"
>Get started</a
>
</li>
<li class="p-inline-list__item">
<a
Expand Down
29 changes: 16 additions & 13 deletions apps/demo/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<script lang="ts">
import { dev } from '$app/environment';
import { page } from '$app/state';
import { resolve } from '$app/paths';
import type { Pathname } from '$app/types';
interface Props {
children?: import('svelte').Snippet;
}

let { children }: Props = $props();

let links = $derived([
type Link = {
path: Pathname;
name: string;
is_selected: boolean;
};

let links: Link[] = $derived([
{
path: '/',
name: 'Home',
Expand All @@ -18,23 +25,19 @@
name: 'Documentation',
is_selected: page.url.pathname.startsWith('/documentation')
},
...(dev
? [
{
path: '/playground',
name: 'Playground',
is_selected: page.url.pathname.startsWith('/playground')
}
]
: [])
{
path: '/playground',
name: 'Playground',
is_selected: page.url.pathname.startsWith('/playground')
}
]);
</script>

<header id="navigation" class="p-navigation is-dark">
<div class="p-navigation__row">
<div class="p-navigation__banner">
<div class="p-navigation__tagged-logo">
<a class="p-navigation__link" href="/">
<a class="p-navigation__link" href={resolve('/')}>
<span class="p-navigation__logo-title">svelte-markdoc-preprocess</span>
</a>
</div>
Expand All @@ -51,7 +54,7 @@
class:is-selected={link.is_selected}
aria-current={link.is_selected ? 'page' : null}
>
<a class="p-navigation__link" href={link.path}>{link.name}</a>
<a class="p-navigation__link" href={resolve(link.path)}>{link.name}</a>
</li>
{/each}
<li class="p-navigation__item">
Expand Down
13 changes: 11 additions & 2 deletions apps/demo/src/routes/documentation/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<script lang="ts">
import { page } from '$app/state';
import { resolve } from '$app/paths';
import type { Pathname } from '$app/types';

interface Props {
children?: import('svelte').Snippet;
}
Expand All @@ -8,7 +11,13 @@

let is_expanded = $state(false);

let links = $derived([
type Link = {
path: Pathname;
name: string;
is_selected: boolean;
};

let links: Link[] = $derived([
{
path: '/documentation',
name: 'Install',
Expand Down Expand Up @@ -92,7 +101,7 @@
<ul>
{#each links as link (link.path)}
<li aria-current={link.is_selected ? 'page' : null}>
<a class:is-active={link.is_selected} href={link.path}>{link.name}</a>
<a class:is-active={link.is_selected} href={resolve(link.path)}>{link.name}</a>
</li>
{/each}
</ul>
Expand Down
11 changes: 6 additions & 5 deletions apps/demo/src/routes/playground/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { resolve } from '$app/paths';
interface Props {
children?: import('svelte').Snippet;
}
Expand All @@ -7,11 +8,11 @@
</script>

<nav>
<a href="/playground/tags">tags</a> |
<a href="/playground/partials">partials</a> |
<a href="/playground/layout">layout</a> |
<a href="/playground/glob">glob</a> |
<a href="/playground/markdown">markdown</a>
<a href={resolve('/playground/tags')}>tags</a> |
<a href={resolve('/playground/partials')}>partials</a> |
<a href={resolve('/playground/layout')}>layout</a> |
<a href={resolve('/playground/glob')}>glob</a> |
<a href={resolve('/playground/markdown')}>markdown</a>
</nav>

{@render children?.()}
3 changes: 2 additions & 1 deletion apps/demo/src/routes/playground/glob/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<script lang="ts">
import { resolve } from '$app/paths';
let { data } = $props();
</script>

{#each data.files as file (file.slug)}
<section>
<h3><a href={`/playground/glob/${file.slug}`}>{file.filepath}</a></h3>
<h3><a href={resolve(`/playground/glob/${file.slug}`)}>{file.filepath}</a></h3>
{#if file.frontmatter}
<p>{JSON.stringify(file.frontmatter)}</p>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions apps/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"check": "docia check"
},
"dependencies": {
"docia": "^0.0.6"
"docia": "^0.0.15"
},
"devDependencies": {
"@types/node": "^22.13.14"
"@types/node": "^22.19.11"
}
}
528 changes: 191 additions & 337 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[install]
linker = "hoisted"
Loading