From a0353c6efd89ef4d9cd513fe656630d91babe246 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Tue, 30 Dec 2025 12:52:18 +0700 Subject: [PATCH] feat: implement basic seo (metadata, sitemap, robots) --- src/app/layout.tsx | 50 ++++++++++++++++++++++++++++++++++++++++++++-- src/app/robots.ts | 14 +++++++++++++ src/app/sitemap.ts | 44 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 src/app/robots.ts create mode 100644 src/app/sitemap.ts diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6467f37..331cb2f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -11,11 +11,57 @@ import { I18nProvider } from '@/components/providers/I18nProvider'; export const metadata: Metadata = { + metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL || 'https://trustlab.dyzulk.com'), title: { template: '%s | TrustLab - PKI & Certificate Management', - default: 'TrustLab - PKI & Certificate Management', + default: 'TrustLab - Secure PKI & Certificate Management System', + }, + description: 'Enterprise-grade Certificate Authority and PKI Management System. Securely manage SSL/TLS certificates, internal CAs, and digital signatures.', + keywords: ['PKI', 'Certificate Authority', 'SSL', 'TLS', 'Security', 'Encryption', 'DevOps', 'Certificate Management'], + authors: [{ name: 'TrustLab Team' }], + creator: 'TrustLab', + publisher: 'TrustLab', + robots: { + index: true, + follow: true, + googleBot: { + index: true, + follow: true, + 'max-video-preview': -1, + 'max-image-preview': 'large', + 'max-snippet': -1, + }, + }, + openGraph: { + type: 'website', + locale: 'en_US', + url: 'https://trustlab.dyzulk.com', + siteName: 'TrustLab', + title: 'TrustLab - Secure PKI & Certificate Management', + description: 'Enterprise-grade Certificate Authority and PKI Management System.', + images: [ + { + url: '/banner.png', + width: 1200, + height: 630, + alt: 'TrustLab Platform', + }, + ], + }, + twitter: { + card: 'summary_large_image', + title: 'TrustLab - PKI & Certificate Management', + description: 'Securely manage SSL/TLS certificates and internal CAs with TrustLab.', + images: ['/banner.png'], + creator: '@dyzulk', + }, + icons: { + icon: '/favicon.ico', + shortcut: '/favicon.ico', + }, + verification: { + google: 'verification_code_placeholder', // User needs to replace this }, - description: 'Advanced Certificate Authority and PKI Management System', }; export default function RootLayout({ diff --git a/src/app/robots.ts b/src/app/robots.ts new file mode 100644 index 0000000..92d54df --- /dev/null +++ b/src/app/robots.ts @@ -0,0 +1,14 @@ +import { MetadataRoute } from 'next'; + +export default function robots(): MetadataRoute.Robots { + const baseUrl = process.env.NEXT_PUBLIC_APP_URL || 'https://trustlab.dyzulk.com'; + + return { + rules: { + userAgent: '*', + allow: '/', + disallow: ['/dashboard/', '/api/'], + }, + sitemap: `${baseUrl}/sitemap.xml`, + }; +} diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts new file mode 100644 index 0000000..3eb3853 --- /dev/null +++ b/src/app/sitemap.ts @@ -0,0 +1,44 @@ +import { MetadataRoute } from 'next'; + +export default function sitemap(): MetadataRoute.Sitemap { + const baseUrl = process.env.NEXT_PUBLIC_APP_URL || 'https://trustlab.dyzulk.com'; + + return [ + { + url: baseUrl, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 1, + }, + { + url: `${baseUrl}/signin`, + lastModified: new Date(), + changeFrequency: 'monthly', + priority: 0.8, + }, + { + url: `${baseUrl}/signup`, + lastModified: new Date(), + changeFrequency: 'monthly', + priority: 0.8, + }, + { + url: `${baseUrl}/contact`, + lastModified: new Date(), + changeFrequency: 'monthly', + priority: 0.7, + }, + { + url: `${baseUrl}/tools/key-generator`, + lastModified: new Date(), + changeFrequency: 'weekly', + priority: 0.9, + }, + { + url: `${baseUrl}/tools/chat-id`, + lastModified: new Date(), + changeFrequency: 'weekly', + priority: 0.9, + }, + ]; +}