feat: favicon, webmanifest, og-default, improved SEO metadata + twitter cards + canonical
@@ -19,16 +19,27 @@ export async function generateMetadata({ params }) {
|
|||||||
const { slug } = await params;
|
const { slug } = await params;
|
||||||
const article = await getArticle(slug);
|
const article = await getArticle(slug);
|
||||||
if (!article) return { title: 'Статья не найдена' };
|
if (!article) return { title: 'Статья не найдена' };
|
||||||
|
const ogImages = article.cover_url
|
||||||
|
? [{ url: article.cover_url.startsWith('http') ? article.cover_url : `https://zeropost.ru${article.cover_url}`, width: 1600, height: 900, alt: article.title }]
|
||||||
|
: [{ url: 'https://zeropost.ru/og-default.png', width: 1200, height: 630 }];
|
||||||
return {
|
return {
|
||||||
title: article.seo_title || article.title,
|
title: article.seo_title || article.title,
|
||||||
description: article.seo_descr || article.excerpt,
|
description: article.seo_descr || article.excerpt,
|
||||||
|
alternates: { canonical: `https://zeropost.ru/blog/${slug}` },
|
||||||
openGraph: {
|
openGraph: {
|
||||||
title: article.title,
|
title: article.title,
|
||||||
description: article.excerpt,
|
description: article.excerpt,
|
||||||
type: 'article',
|
type: 'article',
|
||||||
|
url: `https://zeropost.ru/blog/${slug}`,
|
||||||
publishedTime: article.published_at,
|
publishedTime: article.published_at,
|
||||||
tags: article.tags || [],
|
tags: article.tags || [],
|
||||||
images: article.cover_url ? [{ url: article.cover_url }] : undefined,
|
images: ogImages,
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: article.seo_title || article.title,
|
||||||
|
description: article.seo_descr || article.excerpt,
|
||||||
|
images: ogImages.map(i => i.url),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,50 @@ export const metadata = {
|
|||||||
},
|
},
|
||||||
description: 'Блог про практическое применение искусственного интеллекта. Промпты, инструменты, кейсы — без воды.',
|
description: 'Блог про практическое применение искусственного интеллекта. Промпты, инструменты, кейсы — без воды.',
|
||||||
metadataBase: new URL('https://zeropost.ru'),
|
metadataBase: new URL('https://zeropost.ru'),
|
||||||
|
keywords: ['искусственный интеллект', 'промпт-инжиниринг', 'ChatGPT', 'Claude', 'ИИ инструменты', 'автоматизация'],
|
||||||
|
authors: [{ name: 'ZeroPost', url: 'https://zeropost.ru' }],
|
||||||
|
creator: 'ZeroPost',
|
||||||
|
publisher: 'ZeroPost',
|
||||||
|
robots: {
|
||||||
|
index: true,
|
||||||
|
follow: true,
|
||||||
|
googleBot: { index: true, follow: true },
|
||||||
|
},
|
||||||
openGraph: {
|
openGraph: {
|
||||||
type: 'website',
|
type: 'website',
|
||||||
locale: 'ru_RU',
|
locale: 'ru_RU',
|
||||||
|
url: 'https://zeropost.ru',
|
||||||
siteName: 'ZeroPost',
|
siteName: 'ZeroPost',
|
||||||
|
title: 'ZeroPost — практические материалы про ИИ',
|
||||||
|
description: 'Блог про практическое применение искусственного интеллекта. Промпты, инструменты, кейсы — без воды.',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: '/og-default.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'ZeroPost — практические материалы про ИИ',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: 'ZeroPost — практические материалы про ИИ',
|
||||||
|
description: 'Блог про практическое применение искусственного интеллекта. Промпты, инструменты, кейсы — без воды.',
|
||||||
|
images: ['/og-default.png'],
|
||||||
|
},
|
||||||
|
icons: {
|
||||||
|
icon: [
|
||||||
|
{ url: '/favicon.svg', type: 'image/svg+xml' },
|
||||||
|
{ url: '/favicon-16x16.png', sizes: '16x16', type: 'image/png' },
|
||||||
|
{ url: '/favicon-32x32.png', sizes: '32x32', type: 'image/png' },
|
||||||
|
],
|
||||||
|
apple: [{ url: '/apple-touch-icon.png', sizes: '180x180' }],
|
||||||
|
other: [
|
||||||
|
{ rel: 'manifest', url: '/site.webmanifest' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
alternates: {
|
alternates: {
|
||||||
|
canonical: 'https://zeropost.ru',
|
||||||
types: { 'application/rss+xml': '/rss.xml' },
|
types: { 'application/rss+xml': '/rss.xml' },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 571 B |
@@ -0,0 +1,4 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||||
|
<rect width="32" height="32" rx="8" fill="#10b981"/>
|
||||||
|
<text x="16" y="23" font-family="Inter,Arial,sans-serif" font-size="18" font-weight="800" text-anchor="middle" fill="white" letter-spacing="-1">Z</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 278 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 45 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "ZeroPost",
|
||||||
|
"short_name": "ZeroPost",
|
||||||
|
"description": "Практические материалы про ИИ",
|
||||||
|
"start_url": "/",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#fafaf9",
|
||||||
|
"theme_color": "#10b981",
|
||||||
|
"icons": [
|
||||||
|
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
|
||||||
|
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }
|
||||||
|
]
|
||||||
|
}
|
||||||