Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Add structured data schema for HomePage (#1015)
Richie McIlroy24be1a5b5029
diff --git a/apps/web/components/pages/HomePage/HomePageSchema.tsx b/apps/web/components/pages/HomePage/HomePageSchema.tsxnew file mode 100644index 000000000..07e69ad57--- /dev/null+++ b/apps/web/components/pages/HomePage/HomePageSchema.tsx@@ -0,0 +1,68 @@+"use client";++import Script from "next/script";+import { testimonials } from "@/data/testimonials";+import {+ createBreadcrumbSchema,+ createFAQSchema,+ createOrganizationSchema,+ createProductSchema,+ createSoftwareApplicationSchema,+ createWebSiteSchema,+} from "@/utils/web-schema";++const homePageFAQs = [+ {+ question: "What is Cap?",+ answer:+ "Cap is an open-source screen recording software that offers beautiful, lightweight recordings with instant sharing capabilities. It's the privacy-focused alternative to Loom.",+ },+ {+ question: "How much does Cap cost?",+ answer:+ "Cap offers a generous free plan with Studio mode for personal use and 5-minute shareable links. The Pro plan starts at just $8.16/month per user, which is less than half the price of Loom.",+ },+ {+ question: "Is Cap available for Windows and Mac?",+ answer:+ "Yes, Cap is available for both macOS and Windows, providing consistent performance and features across both platforms.",+ },+ {+ question: "Can I use my own storage with Cap?",+ answer:+ "Yes, Cap allows you to connect your own S3 storage and custom domain, giving you 100% ownership and control over your content.",+ },+ {+ question: "What makes Cap different from other screen recorders?",+ answer:+ "Cap is fully open-source, privacy-focused, and offers unique features like Studio mode (free for personal use), 4K recording at 60fps, built-in thread commenting, and the ability to use your own storage and domain.",+ },+ {+ question: "Does Cap support team collaboration?",+ answer:+ "Yes, Cap includes built-in thread commenting on shareable links, making it easy to collaborate with teammates and collect feedback directly on your recordings.",+ },+];++const createHomePageSchema = () => {+ const schemas = [+ createOrganizationSchema(),+ createWebSiteSchema(),+ createSoftwareApplicationSchema(testimonials),+ createProductSchema(),+ createBreadcrumbSchema([{ name: "Home", url: "https://cap.so" }]),+ createFAQSchema(homePageFAQs),+ ];++ return JSON.stringify(schemas);+};++export const HomePageSchema = () => {+ return (+ <Script+ id="homepage-structured-data"+ type="application/ld+json"+ dangerouslySetInnerHTML={{ __html: createHomePageSchema() }}+ />+ );+};diff --git a/apps/web/components/pages/HomePage/index.tsx b/apps/web/components/pages/HomePage/index.tsxindex f7a75d75e..4dcbbe77a 100644--- a/apps/web/components/pages/HomePage/index.tsx+++ b/apps/web/components/pages/HomePage/index.tsx@@ -7,6 +7,7 @@ import { homepageCopy } from "../../../data/homepage-copy";import Faq from "./Faq";import Features from "./Features";import Header from "./Header";+import { HomePageSchema } from "./HomePageSchema";import Pricing from "./Pricing";import RecordingModes from "./RecordingModes";import Testimonials from "./Testimonials";@@ -20,6 +21,7 @@ export const HomePage: React.FC<HomePageProps> = ({}) => {return (<>+ <HomePageSchema /><Header serverHomepageCopyVariant={serverHomepageCopyVariant} /><div className="space-y-[150px] lg:space-y-[200px]"><RecordingModes />diff --git a/apps/web/public/cap-logo.png b/apps/web/public/cap-logo.pngnew file mode 100644index 000000000..2dd7b82caBinary files /dev/null and b/apps/web/public/cap-logo.png differdiff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.jsonindex 1efbc973b..f279910e6 100644--- a/apps/web/tsconfig.json+++ b/apps/web/tsconfig.json@@ -26,6 +26,7 @@"@/utils/*": ["utils/*"],"@/lib/*": ["lib/*"],"@/actions/*": ["actions/*"],+ "@/data/*": ["data/*"],"@/services": ["services"]},"types": ["node"]diff --git a/apps/web/utils/web-schema.ts b/apps/web/utils/web-schema.tsnew file mode 100644index 000000000..264570a4f--- /dev/null+++ b/apps/web/utils/web-schema.ts@@ -0,0 +1,267 @@+export const createOrganizationSchema = () => ({+ "@context": "https://schema.org",+ "@type": "Organization",+ "@id": "https://cap.so/#organization",+ name: "Cap",+ url: "https://cap.so",+ logo: {+ "@type": "ImageObject",+ url: "https://cap.so/cap-logo.png",+ width: 512,+ height: 512,+ },+ description:+ "Cap is the open source alternative to Loom. Lightweight, powerful, and cross-platform screen recorder.",+ sameAs: [+ "https://github.com/capsoftware/cap",+ "https://twitter.com/cap",+ "https://x.com/cap",+ "https://www.producthunt.com/products/cap-3",+ ],+ contactPoint: {+ "@type": "ContactPoint",+ email: "[email protected]",+ contactType: "customer service",+ },+});++export const createWebSiteSchema = () => ({+ "@context": "https://schema.org",+ "@type": "WebSite",+ "@id": "https://cap.so/#website",+ url: "https://cap.so",+ name: "Cap",+ description:+ "Beautiful screen recordings, owned by you. The open source alternative to Loom.",+ publisher: {+ "@id": "https://cap.so/#organization",+ },+});++import type { Testimonial } from "@/data/testimonials";+import { testimonials as allTestimonials } from "@/data/testimonials";++export const createSoftwareApplicationSchema = (+ testimonials?: readonly Testimonial[],+) => {+ const testimonialsToUse = testimonials || allTestimonials;++ const rogerTestimonial = allTestimonials.find(+ (t) => t.handle === "@_rogermattos",+ );+ const selectedTestimonials = rogerTestimonial+ ? [+ rogerTestimonial,+ ...testimonialsToUse+ .filter((t) => t.handle !== "@_rogermattos")+ .slice(0, 4),+ ]+ : testimonialsToUse.slice(0, 5);++ const reviews = selectedTestimonials.map((testimonial) => ({+ "@type": "Review",+ reviewRating: {+ "@type": "Rating",+ ratingValue: "5",+ },+ author: {+ "@type": "Person",+ name: testimonial.name,+ ...(testimonial.handle && { alternateName: testimonial.handle }),+ },+ reviewBody: testimonial.content,+ url: testimonial.url,+ }));++ return {+ "@context": "https://schema.org",+ "@type": "SoftwareApplication",+ "@id": "https://cap.so/#software",+ name: "Cap",+ applicationCategory: "MultimediaApplication",+ operatingSystem: ["macOS", "Windows"],+ description:+ "Cap is a powerful, open-source screen recording software that offers instant sharing, studio mode, and privacy-focused features.",+ url: "https://cap.so",+ downloadUrl: "https://cap.so/download",+ screenshot: [+ {+ "@type": "ImageObject",+ url: "https://cap.so/og.png",+ caption: "Cap screen recorder interface",+ },+ ],+ featureList: [+ "Screen recording up to 4K resolution",+ "60fps recording",+ "Instant sharing with links",+ "Studio mode for professional editing",+ "Built-in thread commenting",+ "Custom domain support",+ "Own S3 storage integration",+ "Cross-platform (Mac & Windows)",+ "Open source",+ "Privacy-focused",+ ],+ offers: [+ {+ "@type": "Offer",+ price: "0",+ priceCurrency: "USD",+ name: "Free Plan",+ description: "Studio mode for personal use, 5-minute shareable links",+ },+ {+ "@type": "Offer",+ price: "8.16",+ priceCurrency: "USD",+ name: "Pro Plan",+ priceValidUntil: "2025-12-31",+ description: "Full features for professional use",+ eligibleQuantity: {+ "@type": "QuantitativeValue",+ unitText: "month",+ },+ },+ ],+ aggregateRating: {+ "@type": "AggregateRating",+ ratingValue: "4.8",+ reviewCount: allTestimonials.length.toString(),+ bestRating: "5",+ worstRating: "1",+ },+ review: reviews,+ creator: {+ "@id": "https://cap.so/#organization",+ },+ };+};++export const createBreadcrumbSchema = (+ items: Array<{ name: string; url?: string }>,+) => ({+ "@context": "https://schema.org",+ "@type": "BreadcrumbList",+ itemListElement: items.map((item, index) => ({+ "@type": "ListItem",+ position: index + 1,+ name: item.name,+ ...(item.url && { item: item.url }),+ })),+});++export const createVideoObjectSchema = (video: {+ name: string;+ description: string;+ thumbnailUrl: string;+ uploadDate?: string;+ duration?: string;+ embedUrl?: string;+}) => ({+ "@context": "https://schema.org",+ "@type": "VideoObject",+ name: video.name,+ description: video.description,+ thumbnailUrl: video.thumbnailUrl,+ uploadDate: video.uploadDate || new Date().toISOString(),+ duration: video.duration || "PT2M",+ embedUrl: video.embedUrl,+ publisher: {+ "@id": "https://cap.so/#organization",+ },+});++export const createFAQSchema = (+ faqs: Array<{ question: string; answer: string }>,+) => ({+ "@context": "https://schema.org",+ "@type": "FAQPage",+ mainEntity: faqs.map((faq) => ({+ "@type": "Question",+ name: faq.question,+ acceptedAnswer: {+ "@type": "Answer",+ text: faq.answer.replace(/<\/?[^>]+(>|$)/g, ""),+ },+ })),+});++export const createProductSchema = () => ({+ "@context": "https://schema.org",+ "@type": "Product",+ name: "Cap Screen Recorder",+ description:+ "Open-source screen recording software with instant sharing and studio mode capabilities",+ brand: {+ "@type": "Brand",+ name: "Cap",+ },+ offers: {+ "@type": "AggregateOffer",+ priceCurrency: "USD",+ lowPrice: "0",+ highPrice: "8.16",+ offerCount: "2",+ },+ aggregateRating: {+ "@type": "AggregateRating",+ ratingValue: "4.8",+ reviewCount: "250",+ },+});++export const createComparisonTableSchema = () => ({+ "@context": "https://schema.org",+ "@type": "Table",+ about: "Feature comparison between Cap and Loom screen recorders",+ mainEntity: {+ "@type": "ItemList",+ itemListElement: [+ {+ "@type": "ListItem",+ position: 1,+ name: "Open Source",+ item: {+ "@type": "PropertyValue",+ name: "Cap",+ value: "Yes",+ },+ },+ {+ "@type": "ListItem",+ position: 2,+ name: "Pricing",+ item: {+ "@type": "PropertyValue",+ name: "Cap",+ value: "$8.16/month per user",+ },+ },+ {+ "@type": "ListItem",+ position: 3,+ name: "4K Recording",+ item: {+ "@type": "PropertyValue",+ name: "Cap",+ value: "Available in free & paid plans",+ },+ },+ ],+ },+});++export const createLocalBusinessSchema = () => ({+ "@context": "https://schema.org",+ "@type": "LocalBusiness",+ name: "Cap",+ image: "https://cap.so/og.png",+ "@id": "https://cap.so",+ url: "https://cap.so",+ priceRange: "$0-$8.16",+ address: {+ "@type": "PostalAddress",+ addressCountry: "US",+ },+});