From 5017dbbfb8a90aab28180636164592187e1ad9a3 Mon Sep 17 00:00:00 2001
From: tglide <26071571+TGlide@users.noreply.github.com>
Date: Fri, 28 Apr 2023 19:22:47 +0100
Subject: [PATCH] fix: seo
---
src/lib/layout/header.svelte | 21 ++++++++++++---------
src/routes/card/[uid]/+page.svelte | 3 ---
src/routes/card/[uid]/+page.ts | 3 +++
src/routes/card/display.svelte | 9 ++++++---
4 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/src/lib/layout/header.svelte b/src/lib/layout/header.svelte
index 01c063faf..1b8e7863e 100644
--- a/src/lib/layout/header.svelte
+++ b/src/lib/layout/header.svelte
@@ -21,6 +21,7 @@
import { Submit, trackEvent } from '$lib/actions/analytics';
import { sdkForConsole } from '$lib/stores/sdk';
import { slide } from 'svelte/transition';
+ import { isCloud } from '$lib/system';
let showFeedback = false;
let showDropdown = false;
@@ -212,15 +213,17 @@
-
+ {#if isCloud}
+
+ {/if}
{/if}
diff --git a/src/routes/card/[uid]/+page.svelte b/src/routes/card/[uid]/+page.svelte
index ab916bfcb..e3f908620 100644
--- a/src/routes/card/[uid]/+page.svelte
+++ b/src/routes/card/[uid]/+page.svelte
@@ -1,10 +1,7 @@
diff --git a/src/routes/card/[uid]/+page.ts b/src/routes/card/[uid]/+page.ts
index 913a47f4e..c54acf617 100644
--- a/src/routes/card/[uid]/+page.ts
+++ b/src/routes/card/[uid]/+page.ts
@@ -1,6 +1,9 @@
import { redirect } from '@sveltejs/kit';
import { getCardImgUrls } from '../helpers.js';
+export const prerender = true;
+export const ssr = true;
+
export async function load({ params }) {
const userId = params.uid;
const { frontImg } = getCardImgUrls(userId);
diff --git a/src/routes/card/display.svelte b/src/routes/card/display.svelte
index 7c110b36d..6250cef63 100644
--- a/src/routes/card/display.svelte
+++ b/src/routes/card/display.svelte
@@ -8,6 +8,7 @@
import { Modal } from '$lib/components';
import Code from '$lib/components/code.svelte';
import Button from '$lib/elements/forms/button.svelte';
+ import { browser } from '$app/environment';
export let userId: string;
export let variant: 'owner' | 'external';
@@ -29,7 +30,8 @@
const { frontImg, ogImg } = getCardImgUrls(userId);
$: title = variant === 'owner' ? 'Welcome to the cloud' : 'Join the Appwrite Cloud';
- $: shareableLink = `${window.location.origin}/card/${userId}`;
+ $: shareableLink =
+ typeof window !== 'undefined' ? `${window.location.origin}/card/${userId}` : '';
$: embedCode = [
``,
`\t
`,
@@ -71,7 +73,6 @@
-
@@ -178,7 +179,9 @@
fallDistance="50px" />
{/if}
-
+ {#if browser}
+
+ {/if}
{#if cardActive}