mirror of
https://github.com/cupcakearmy/nicco.io.git
synced 2024-12-22 16:16:24 +00:00
redirect warning
This commit is contained in:
parent
f1b3f1011b
commit
fcf7907d16
@ -1,6 +1,9 @@
|
|||||||
<script context="module">
|
<script context="module">
|
||||||
export async function preload() {
|
export async function preload(page) {
|
||||||
return this.fetch('/api/posts.json').then((res) => res.json())
|
return {
|
||||||
|
...(await this.fetch('/api/posts.json').then((res) => res.json())),
|
||||||
|
redirected: page.query.old !== undefined,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -9,13 +12,31 @@
|
|||||||
import PostPreview from '../../components/PostPreview.svelte'
|
import PostPreview from '../../components/PostPreview.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
export let redirected
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
margin-bottom: 6em;
|
||||||
|
background-color: var(--clr-error);
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>Blog</title>
|
<title>Blog</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<SimplePage title="Blog">
|
<SimplePage title="Blog">
|
||||||
|
{#if redirected}
|
||||||
|
<div>
|
||||||
|
<h2>You have been redirected 🔄</h2>
|
||||||
|
<p>
|
||||||
|
Probably you are coming form my old blog (blog.nicco.io)
|
||||||
|
<br />
|
||||||
|
The article you were looking for is down here 👇
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{#each data as post}
|
{#each data as post}
|
||||||
<PostPreview {post} />
|
<PostPreview {post} />
|
||||||
{/each}
|
{/each}
|
||||||
|
Loading…
Reference in New Issue
Block a user