feat: add og description\image\etc

This commit is contained in:
2026-10-07 20:07:03 +05:00
parent fbe6139585
commit 31ace359d7
9 changed files with 122 additions and 9 deletions
+30
View File
@@ -0,0 +1,30 @@
<script lang="ts">
import { SITE_URL } from "$lib/seo";
interface Props {
title: string;
description: string;
/** Путь страницы от корня роутера ("/", "/list-tools", "/tools/…"). */
path: string;
}
let { title, description, path }: Props = $props();
const url = $derived(`${SITE_URL}${path}`);
const image = `${SITE_URL}/og/default.png`;
</script>
<svelte:head>
<title>{title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={url} />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="easy-png-tools" />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={url} />
<meta property="og:image" content={image} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={image} />
</svelte:head>
+6
View File
@@ -0,0 +1,6 @@
/**
* Публичный URL сайта для canonical/OG (абсолютные URL, включая base-path
* GitHub Pages). После покупки домена меняется здесь — `docs/plan-seo.md` §6.
* Внимание: `$app/paths.base` для этого не подходит — он относительный.
*/
export const SITE_URL = "https://ku6epxboctuk.github.io/easy-png-tools";