aboutsummaryrefslogtreecommitdiff
path: root/src/routes/tools
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-19 00:26:17 -0800
committerFuwn <[email protected]>2024-01-19 00:26:17 -0800
commit20fafa287adec1382257622fc23bd6f58b09f3a2 (patch)
tree863f09c3dc86e9a50ba4b0c4433d4ef7cd4ab3c1 /src/routes/tools
parentfix(schedule): force list mode flag column count (diff)
downloaddue.moe-20fafa287adec1382257622fc23bd6f58b09f3a2.tar.xz
due.moe-20fafa287adec1382257622fc23bd6f58b09f3a2.zip
feat: root prefix all links
Diffstat (limited to 'src/routes/tools')
-rw-r--r--src/routes/tools/+page.svelte3
-rw-r--r--src/routes/tools/[tool]/+page.svelte5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelte
index f5cbe36a..edc18410 100644
--- a/src/routes/tools/+page.svelte
+++ b/src/routes/tools/+page.svelte
@@ -2,6 +2,7 @@
import HeadTitle from '$lib/Home/HeadTitle.svelte';
import Picker from '$lib/Tools/Picker.svelte';
import { tools } from '$lib/Tools/tools.js';
+ import root from '$lib/Utility/root';
let tool = 'default';
</script>
@@ -17,7 +18,7 @@
{#each Object.keys(tools) as t}
{#if t !== 'default'}
<li>
- <a href={`/tools/${tools[t].id}`} on:click={() => (tool = t)}>{tools[t].name}</a>
+ <a href={root(`/tools/${tools[t].id}`)} on:click={() => (tool = t)}>{tools[t].name}</a>
{#if tools[t].description}
<blockquote>{tools[t].description}</blockquote>
{/if}
diff --git a/src/routes/tools/[tool]/+page.svelte b/src/routes/tools/[tool]/+page.svelte
index adcd6442..945acbd4 100644
--- a/src/routes/tools/[tool]/+page.svelte
+++ b/src/routes/tools/[tool]/+page.svelte
@@ -13,13 +13,14 @@
import { goto } from '$app/navigation';
import Picker from '$lib/Tools/Picker.svelte';
import Likes from '$lib/Tools/Likes.svelte';
+ import root from '$lib/Utility/root.js';
export let data;
let tool = data.tool ?? 'default';
onMount(() => {
- if (tool === 'default') goto('/tools');
+ if (tool === 'default') goto(root('/tools'));
});
$: suggestion = closest(tool, Object.keys(tools));
@@ -35,7 +36,7 @@
<blockquote style="margin: 0 0 0 1.5rem;">
Did you mean "<a
- href={`/tools/${tools[suggestion].id}`}
+ href={root(`/tools/${tools[suggestion].id}`)}
on:click={() => (tool = suggestion)}
style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''}
>