misc: change svelte:head
This commit is contained in:
1 parent
39ce616d0d
commit
ff3246c0a6
5 files changed
+24
-40
No files matched your search
@@ -86,6 +86,7 @@ authData.subscribe(async (data) => {
|
|||||||
localStorage.setItem('user', JSON.stringify(data))
|
localStorage.setItem('user', JSON.stringify(data))
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
authData.set(undefined)
|
authData.set(undefined)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -14,11 +14,21 @@
|
|||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{data.posts.posts[0]?.community.name}</title>
|
<title>{data.posts.posts[0]?.community.name}</title>
|
||||||
|
<meta
|
||||||
|
name="og:title"
|
||||||
|
content={data.community.community_view.community.name}
|
||||||
|
/>
|
||||||
|
{#if data.community.community_view.community.description}
|
||||||
|
<meta
|
||||||
|
name="og:description"
|
||||||
|
content={data.community.community_view.community.description}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
<meta name="og:url" content={$page.url.toString()} />
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex flex-col md:flex-row gap-4 w-full">
|
<div class="flex flex-col md:flex-row gap-4 w-full">
|
||||||
<div class="md:hidden">
|
<div class="md:hidden">
|
||||||
{#await data.streamed.community then community}
|
|
||||||
<details>
|
<details>
|
||||||
<summary class="flex flex-row">
|
<summary class="flex flex-row">
|
||||||
<div
|
<div
|
||||||
@@ -28,9 +38,8 @@
|
|||||||
Sidebar
|
Sidebar
|
||||||
</div>
|
</div>
|
||||||
</summary>
|
</summary>
|
||||||
<CommunityCard community_view={community.community_view} />
|
<CommunityCard community_view={data.community.community_view} />
|
||||||
</details>
|
</details>
|
||||||
{/await}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full">
|
<div class="flex flex-col gap-4 max-w-full w-full">
|
||||||
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
||||||
@@ -67,39 +76,6 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden md:block">
|
<div class="hidden md:block">
|
||||||
{#await data.streamed.community}
|
<CommunityCard community_view={data.community.community_view} />
|
||||||
<Card>
|
|
||||||
<div
|
|
||||||
class="w-[64px] h-[64px] rounded-full bg-slate-200
|
|
||||||
dark:bg-zinc-700 animate-pulse"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="w-32 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
|
||||||
rounded-md"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="w-64 h-3 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
|
||||||
rounded-md"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="w-36 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
|
||||||
rounded-md"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="w-full h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
|
||||||
rounded-md"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="w-24 h-4 bg-slate-200 dark:bg-zinc-700 animate-pulse
|
|
||||||
rounded-md"
|
|
||||||
/>
|
|
||||||
</Card>
|
|
||||||
{:then community}
|
|
||||||
<CommunityCard community_view={community.community_view} />
|
|
||||||
{:catch}
|
|
||||||
<Card>
|
|
||||||
<p>Failed to load community. This is likely an issue on Lemmy's end.</p>
|
|
||||||
</Card>
|
|
||||||
{/await}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -16,10 +16,8 @@ export async function load(req: any) {
|
|||||||
sort: sort,
|
sort: sort,
|
||||||
auth: get(authData)?.token,
|
auth: get(authData)?.token,
|
||||||
}),
|
}),
|
||||||
streamed: {
|
|
||||||
community: getClient().getCommunity({
|
community: getClient().getCommunity({
|
||||||
name: req.params.name,
|
name: req.params.name,
|
||||||
}),
|
}),
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>Login</svelte:head>
|
<svelte:head><title>Login</title></svelte:head>
|
||||||
|
|
||||||
<!-- <div
|
<!-- <div
|
||||||
class="p-4 absolute top-[50%] left-[50%] translate-x-[-50%]
|
class="p-4 absolute top-[50%] left-[50%] translate-x-[-50%]
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
||||||
import Button from '$lib/components/input/Button.svelte'
|
import Button from '$lib/components/input/Button.svelte'
|
||||||
|
import { page } from '$app/stores'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -41,6 +42,14 @@
|
|||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{data.post.post_view.post.name}</title>
|
<title>{data.post.post_view.post.name}</title>
|
||||||
|
<meta property="og:title" content={data.post.post_view.post.name} />
|
||||||
|
<meta property="og:url" content={$page.url.toString()} />
|
||||||
|
{#if isImage(post.url)}
|
||||||
|
<meta property="og:image" content={post.url} />
|
||||||
|
{/if}
|
||||||
|
{#if post.body}
|
||||||
|
<meta property="og:description" content={post.body} />
|
||||||
|
{/if}
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
|
|||||||
Reference in new issue
Block a user