mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: seo optimizations + opengraph embeds
fix: nullable AuthorUUIDs; assign admins member & mod role
This commit is contained in:
@@ -2,7 +2,7 @@ import type { PageServerLoad } from './$types';
|
||||
import { getServerToken } from '$lib/utils/auth';
|
||||
import type { User } from '$lib/types/user';
|
||||
|
||||
export const load: PageServerLoad = async ({ params, fetch, cookies }) => {
|
||||
export const load: PageServerLoad = async ({ params, fetch, cookies, url }) => {
|
||||
const { username } = params;
|
||||
const token = getServerToken(cookies);
|
||||
const res = await fetch(`/api/user/${username}`, {
|
||||
@@ -12,5 +12,5 @@ export const load: PageServerLoad = async ({ params, fetch, cookies }) => {
|
||||
});
|
||||
|
||||
const user = (await res.json()) as User;
|
||||
return { user };
|
||||
return { user, url: url.href };
|
||||
};
|
||||
|
||||
@@ -113,6 +113,17 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{data.user.displayName || data.user.username} - User Profile</title>
|
||||
|
||||
<meta property="og:title" content="{data.user.displayName || data.user.username} - User Profile" />
|
||||
<meta property="og:description" content="View the profile and {pagination.totalCount} paste{pagination.totalCount !== 1 ? 's' : ''} of {data.user.displayName || data.user.username} on Sharpbin." />
|
||||
<meta property="og:type" content="profile" />
|
||||
<meta property="og:url" content="{data.url}" />
|
||||
<meta property="og:site_name" content="Sharpbin" />
|
||||
<meta property="profile:username" content="{data.user.username}" />
|
||||
</svelte:head>
|
||||
|
||||
<main
|
||||
class="flex min-h-screen w-full flex-col items-center justify-center bg-neutral-950 text-white"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user