CoolFace
Apppublic

Exched/DeepSeek_Coder

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
seo.ts132 linesDownload Raw Back to lib
1import { Metadata } from "next";2 3interface SEOParams {4  title?: string;5  description?: string;6  path?: string;7  image?: string;8  noIndex?: boolean;9  canonical?: string;10}11 12export function generateSEO({13  title = "DeepSite | Build with AI ✨",14  description = "DeepSite is a web development tool that helps you build websites with AI, no code required. Let's deploy your website with DeepSite and enjoy the magic of AI.",15  path = "",16  image = "/banner.png",17  noIndex = false,18  canonical,19}: SEOParams = {}): Metadata {20  const baseUrl = "https://deepsite.hf.co";21  const fullUrl = `${baseUrl}${path}`;22  const canonicalUrl = canonical || fullUrl;23  24  return {25    title,26    description,27    alternates: {28      canonical: canonicalUrl,29    },30    robots: noIndex 31      ? { 32          index: false, 33          follow: false,34          googleBot: {35            index: false,36            follow: false,37            'max-video-preview': -1,38            'max-image-preview': 'large',39            'max-snippet': -1,40          }41        }42      : {43          index: true,44          follow: true,45          googleBot: {46            index: true,47            follow: true,48            'max-video-preview': -1,49            'max-image-preview': 'large',50            'max-snippet': -1,51          }52        },53    openGraph: {54      title,55      description,56      url: canonicalUrl,57      siteName: "DeepSite",58      images: [59        {60          url: `${baseUrl}${image}`,61          width: 1200,62          height: 630,63          alt: `${title} - DeepSite`,64        },65      ],66      locale: "en_US",67      type: "website",68    },69    twitter: {70      card: "summary_large_image",71      title,72      description,73      images: [`${baseUrl}${image}`],74      creator: "@deepsite",75    },76    other: {77      // Prevent iframe embedding from unauthorized domains78      'X-Frame-Options': 'SAMEORIGIN',79      // Control how the page appears when shared80      'og:image:secure_url': `${baseUrl}${image}`,81      // Help search engines understand the primary URL82      'rel': 'canonical',83    },84  };85}86 87export function generateStructuredData(type: 'WebApplication' | 'Organization' | 'Article', data: any) {88  const baseStructuredData = {89    '@context': 'https://schema.org',90    '@type': type,91  };92 93  switch (type) {94    case 'WebApplication':95      return {96        ...baseStructuredData,97        name: 'DeepSite',98        description: 'Build websites with AI, no code required',99        url: 'https://deepsite.hf.co',100        applicationCategory: 'DeveloperApplication',101        operatingSystem: 'Web',102        offers: {103          '@type': 'Offer',104          price: '0',105          priceCurrency: 'USD',106        },107        creator: {108          '@type': 'Organization',109          name: 'DeepSite',110          url: 'https://deepsite.hf.co',111        },112        ...data,113      };114    115    case 'Organization':116      return {117        ...baseStructuredData,118        name: 'DeepSite',119        url: 'https://deepsite.hf.co',120        logo: 'https://deepsite.hf.co/logo.svg',121        description: 'AI-powered web development platform',122        sameAs: [123          // Add social media links here if available124        ],125        ...data,126      };127    128    default:129      return { ...baseStructuredData, ...data };130  }131}132