Skip to content

Commit a43ab65

Browse files
committed
add error page & update homepage
1 parent 866fb71 commit a43ab65

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

src/components/head.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
<meta property="og:title" content={title} />
2020
<meta property="og:type" content={type} />
21-
<meta property="og:url" content={ogUrl} />
21+
{#if url !== false}
22+
<meta property="og:url" content={ogUrl} />
23+
{/if}
2224
<meta
2325
property="og:image"
2426
content="https://www.gravatar.com/avatar/14ef2f372719714e6084be2efb400f069316e03aa62c87a28e17f92544a547e0?s=200" />

src/routes/+error.svelte

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script>
2+
import Head from "$components/head.svelte";
3+
import { page } from '$app/state';
4+
5+
const config = {
6+
title: "Oops",
7+
description: "You got error",
8+
type: "error",
9+
url: false,
10+
};
11+
</script>
12+
13+
<svelte:head>
14+
<Head {config} />
15+
</svelte:head>
16+
17+
<section class="flex justify-center items-center h-3/4">
18+
<div class="text-center">
19+
<h2 class="text-6xl font-extrabold my-2">{page.status}</h2>
20+
<p class="text-sm text-gray-500">If you in here, let me explain this.</p>
21+
<p class="text-sm text-gray-500"> You have a message <span class="font-bold text-gray-200">"{page.error.message}"</span></p>
22+
</div>
23+
</section>

src/routes/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
<Head {config} />
1515
</svelte:head>
1616

17-
<h2 class="text-xl font-extrabold">Welcome to My Homepage 🎉</h2>
18-
<img src="/memes/meme-1.png" alt="Salam akal sehat" />
17+
<h2 class="text-xl font-extrabold text-center">Welcome to My Homepage 🎉</h2>
18+
<img class="w-1/2 md:w-1/4 mx-auto" src="/memes/meme-1.png" alt="Salam akal sehat" />

svelte.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const config = {
2020
kit: {
2121
adapter: adapter({
2222
pages: "dist",
23-
precompress: false,
2423
strict: true,
2524
}),
2625
alias: {

0 commit comments

Comments
 (0)