Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
feat: New system for creating blog posts + System Audio post
Richie McIlroy54441028bb19
diff --git a/apps/web/app/blog/record-screen-mac-system-audio/page.tsx b/apps/web/app/blog/record-screen-mac-system-audio/page.tsxnew file mode 100644index 000000000..9d0968efb--- /dev/null+++ b/apps/web/app/blog/record-screen-mac-system-audio/page.tsx@@ -0,0 +1,18 @@+import { BlogTemplate } from "@/components/blog/BlogTemplate";+import { recordScreenMacContent } from "../../../content/blog-content/record-screen-mac-system-audio";+import { Metadata } from "next";+import { RecordScreenMacStructuredData } from "@/components/blog/RecordScreenMacStructuredData";++export const metadata: Metadata = {+ title: recordScreenMacContent.title,+ description: recordScreenMacContent.description,+};++export default function RecordScreenMacPage() {+ return (+ <>+ <RecordScreenMacStructuredData />+ <BlogTemplate content={recordScreenMacContent} />+ </>+ );+}diff --git a/apps/web/components/Footer.tsx b/apps/web/components/Footer.tsxindex 0baed2853..bab493bf7 100644--- a/apps/web/components/Footer.tsx+++ b/apps/web/components/Footer.tsx@@ -92,7 +92,6 @@ export const Footer = () => {pathname.includes("/invite") ||pathname.includes("/s/") ||pathname.includes("/onboarding") ||- pathname.includes("/record") ||(typeof window !== "undefined" && window.location.href.includes("cap.link")))return null;diff --git a/apps/web/components/Navbar.tsx b/apps/web/components/Navbar.tsxindex 5f36d9353..9273b09b1 100644--- a/apps/web/components/Navbar.tsx+++ b/apps/web/components/Navbar.tsx@@ -103,7 +103,6 @@ export const Navbar = ({ auth }: { auth: boolean }) => {pathname.includes("/invite") ||pathname.includes("/s/") ||pathname.includes("/onboarding") ||- pathname.includes("/record") ||(typeof window !== "undefined" && window.location.href.includes("cap.link")))return null;diff --git a/apps/web/components/blog/BlogTemplate.tsx b/apps/web/components/blog/BlogTemplate.tsxnew file mode 100644index 000000000..329ac66ff--- /dev/null+++ b/apps/web/components/blog/BlogTemplate.tsx@@ -0,0 +1,474 @@+"use client";++import { Button } from "@cap/ui";+import Link from "next/link";+import { formatDate } from "../../lib/utils";+import { useEffect } from "react";+import MuxPlayer from "@mux/mux-player-react";++interface BlogPost {+ title: string;+ description: string;+ publishedAt: string;+ category: string;+ image?: string;+ author: string;+ tags: string[];+ heroTLDR: string;+ comparisonTable?: {+ title: string;+ headers: string[];+ rows: string[][];+ };+ methods?: {+ title: string;+ description: string;+ steps: {+ title?: string;+ content: string;+ }[];+ }[];+ troubleshooting?: {+ title: string;+ items: {+ question: string;+ answer: string;+ }[];+ };+ proTips?: {+ title: string;+ tips: {+ title: string;+ description: string;+ }[];+ };+ videoDemo?: {+ title: string;+ videoSrc: string;+ caption: string;+ };+ faqs?: {+ question: string;+ answer: string;+ }[];+ testimonial?: {+ quote: string;+ author: string;+ avatar: string;+ };+ cta: {+ title: string;+ description: string;+ buttonText: string;+ buttonLink: string;+ subtitle: string;+ };+ relatedLinks?: {+ text: string;+ url: string;+ }[];+}++const renderHTML = (content: string) => {+ const styledContent = content.replace(+ /<a\s/g,+ '<a class="font-semibold text-blue-500 hover:text-blue-600 transition-colors" '+ );++ return <div dangerouslySetInnerHTML={{ __html: styledContent }} />;+};++export const BlogTemplate = ({ content }: { content: BlogPost }) => {+ useEffect(() => {+ const animateClouds = () => {+ const cloud1 = document.getElementById("blog-cloud-1");+ const cloud2 = document.getElementById("blog-cloud-2");++ if (cloud1 && cloud2) {+ cloud1.animate(+ [+ { transform: "translateX(0) translateY(0)" },+ { transform: "translateX(-10px) translateY(5px)" },+ { transform: "translateX(10px) translateY(-5px)" },+ { transform: "translateX(0) translateY(0)" },+ ],+ {+ duration: 15000,+ iterations: Infinity,+ easing: "ease-in-out",+ }+ );++ cloud2.animate(+ [+ { transform: "translateX(0) translateY(0)" },+ { transform: "translateX(10px) translateY(-5px)" },+ { transform: "translateX(-10px) translateY(5px)" },+ { transform: "translateX(0) translateY(0)" },+ ],+ {+ duration: 18000,+ iterations: Infinity,+ easing: "ease-in-out",+ }+ );+ }+ };++ animateClouds();+ }, []);++ return (+ <article className="px-3 max-w-3xl mx-auto py-24 bg-gradient-to-b from-white to-gray-50 relative z-10">+ {/* Header */}+ <header className="mb-16 text-center">+ <div className="mb-4 text-sm font-medium text-blue-600 fade-in-down">+ {content.category}+ </div>+ <h1 className="text-4xl md:text-5xl font-bold text-gray-900 mb-6 fade-in-down">+ {content.title}+ </h1>+ <p className="text-xl md:text-2xl mb-8 max-w-3xl mx-auto text-gray-700 fade-in-down animate-delay-1">+ {content.description}+ </p>+ <div className="flex items-center justify-center space-x-2 text-sm text-gray-500 fade-in-down animate-delay-2">+ <time dateTime={content.publishedAt}>+ {formatDate(content.publishedAt)}+ </time>+ <span>β’</span>+ <span>by {content.author}</span>+ </div>+ </header>++ {/* Featured Image */}+ {content.image && (+ <div className="mb-12 rounded-xl overflow-hidden shadow-xl transform hover:-translate-y-1 transition-all duration-300">+ <img+ src={content.image}+ alt={content.title}+ className="w-full h-auto object-cover"+ />+ </div>+ )}++ {/* Hero TL;DR */}+ <div className="mb-12 bg-blue-50 p-8 rounded-xl border border-blue-100 shadow-md hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1">+ <h2 className="text-2xl font-bold text-gray-900 mb-4 relative inline-block">+ TL;DR+ <span className="absolute -bottom-1 left-0 w-16 h-1 bg-blue-500 rounded-full"></span>+ </h2>+ <p className="text-xl text-gray-700 mt-6">{content.heroTLDR}</p>+ <div className="mt-6 inline-flex">+ <Button+ href={content.cta.buttonLink}+ size="lg"+ variant="radialblue"+ className="px-6 py-3 shadow-lg hover:shadow-xl transform hover:-translate-y-1 transition-all duration-300"+ >+ {content.cta.buttonText}+ </Button>+ </div>+ </div>++ {/* Comparison Table */}+ {content.comparisonTable && (+ <section className="mb-16">+ <h2 className="text-3xl font-bold text-gray-900 mb-8 relative inline-block">+ {content.comparisonTable.title}+ <span className="absolute -bottom-2 left-1/2 transform -translate-x-1/2 w-20 h-1 bg-blue-500 rounded-full"></span>+ </h2>++ <div className="overflow-x-auto">+ <table className="w-full border-collapse rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-all duration-300">+ <thead className="bg-blue-50">+ <tr>+ {content.comparisonTable.headers.map((header, index) => (+ <th+ key={index}+ className="py-4 px-6 text-left text-gray-700 font-semibold border-b border-gray-200"+ >+ {header}+ </th>+ ))}+ </tr>+ </thead>+ <tbody>+ {content.comparisonTable.rows.map((row, rowIndex) => (+ <tr+ key={rowIndex}+ className={rowIndex % 2 === 0 ? "bg-white" : "bg-gray-50"}+ >+ {row.map((cell, cellIndex) => (+ <td+ key={cellIndex}+ className="py-4 px-6 border-b border-gray-200"+ dangerouslySetInnerHTML={{ __html: cell }}+ />+ ))}+ </tr>+ ))}+ </tbody>+ </table>+ </div>+ </section>+ )}++ {/* Methods */}+ {content.methods &&+ content.methods.map((method, index) => (+ <section key={index} className="mb-16">+ <h2 className="text-3xl font-bold text-gray-900 mb-6 relative inline-block">+ {method.title}+ <span className="absolute -bottom-2 left-1/2 transform -translate-x-1/2 w-20 h-1 bg-blue-500 rounded-full"></span>+ </h2>+ <p className="mb-8 text-xl text-gray-700">{method.description}</p>++ {method.steps.map((step, stepIndex) => (+ <div+ key={stepIndex}+ className="mb-8 p-6 bg-white rounded-xl shadow-md hover:shadow-xl transition-all duration-300 border border-gray-100 hover:border-blue-100 transform hover:-translate-y-1"+ >+ {step.title && (+ <h3 className="text-2xl font-semibold text-gray-800 mb-4">+ {step.title}+ </h3>+ )}+ <div className="prose prose-lg max-w-none">+ {renderHTML(step.content)}+ </div>+ </div>+ ))}+ </section>+ ))}++ {/* Troubleshooting */}+ {content.troubleshooting && (+ <section className="mb-16">+ <h2 className="text-3xl font-bold text-gray-900 mb-8 relative inline-block">+ {content.troubleshooting.title}+ <span className="absolute -bottom-2 left-1/2 transform -translate-x-1/2 w-20 h-1 bg-blue-500 rounded-full"></span>+ </h2>++ <div className="space-y-4">+ {content.troubleshooting.items.map((item, index) => (+ <details+ key={index}+ className="bg-white p-6 rounded-xl shadow-md hover:shadow-xl transition-all duration-300 border border-gray-100 hover:border-blue-100"+ >+ <summary className="text-xl font-semibold text-gray-800 cursor-pointer">+ {item.question}+ </summary>+ <p className="mt-4 text-gray-700">{item.answer}</p>+ </details>+ ))}+ </div>+ </section>+ )}++ {/* Pro Tips */}+ {content.proTips && (+ <section className="mb-16">+ <h2 className="text-3xl font-bold text-gray-900 mb-8 relative inline-block">+ {content.proTips.title}+ <span className="absolute -bottom-2 left-1/2 transform -translate-x-1/2 w-20 h-1 bg-blue-500 rounded-full"></span>+ </h2>++ <div className="grid grid-cols-1 md:grid-cols-3 gap-6">+ {content.proTips.tips.map((tip, index) => (+ <div+ key={index}+ className="bg-blue-50 p-6 rounded-xl border border-blue-100 shadow-md hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1"+ >+ <h3 className="text-xl font-semibold text-blue-800 mb-3">+ πΉ {tip.title}+ </h3>+ <p className="text-gray-700">{tip.description}</p>+ </div>+ ))}+ </div>+ </section>+ )}++ {/* Video Demo */}+ {content.videoDemo && (+ <section className="mb-16">+ <h2 className="text-3xl font-bold text-gray-900 mb-6 relative inline-block">+ {content.videoDemo.title}+ <span className="absolute -bottom-2 left-1/2 transform -translate-x-1/2 w-20 h-1 bg-blue-500 rounded-full"></span>+ </h2>++ <figure className="rounded-xl overflow-hidden shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1">+ <MuxPlayer+ playbackId="A6oZoUWVZjOIVZB6XnBMLagYnXE6xhDhp8Hcyky018hk"+ metadataVideoTitle="Cap Demo"+ accentColor="#5C9FFF"+ style={{ aspectRatio: "16/9", width: "100%" }}+ />+ </figure>+ </section>+ )}++ {/* FAQs */}+ {content.faqs && (+ <section className="mb-16">+ <h2 className="text-3xl font-bold text-gray-900 mb-8 relative inline-block">+ Frequently Asked Questions+ <span className="absolute -bottom-2 left-1/2 transform -translate-x-1/2 w-20 h-1 bg-blue-500 rounded-full"></span>+ </h2>++ <div className="space-y-4">+ {content.faqs.map((faq, index) => (+ <details+ key={index}+ className="bg-white p-6 rounded-xl shadow-md hover:shadow-xl transition-all duration-300 border border-gray-100 hover:border-blue-100"+ >+ <summary className="text-xl font-semibold text-gray-800 cursor-pointer">+ {faq.question}+ </summary>+ <p className="mt-4 text-gray-700">{faq.answer}</p>+ </details>+ ))}+ </div>+ </section>+ )}++ {/* Testimonial */}+ {content.testimonial && (+ <section className="mb-16">+ <h2 className="text-3xl font-bold text-gray-900 mb-8 relative inline-block">+ What Users Are Saying+ <span className="absolute -bottom-2 left-1/2 transform -translate-x-1/2 w-20 h-1 bg-blue-500 rounded-full"></span>+ </h2>++ <blockquote className="bg-white p-8 rounded-xl shadow-md hover:shadow-xl transition-all duration-300 border-l-4 border-blue-500 transform hover:-translate-y-1">+ <p className="text-xl italic text-gray-700 mb-6">+ "{content.testimonial.quote}"+ </p>+ <footer className="flex items-center">+ <img+ src={content.testimonial.avatar}+ alt={content.testimonial.author}+ className="w-12 h-12 rounded-full mr-4"+ />+ <cite className="text-gray-900 font-medium not-italic">+ {content.testimonial.author}+ </cite>+ </footer>+ </blockquote>+ </section>+ )}++ {/* CTA Section */}+ <section className="mb-16">+ <div+ className="relative overflow-hidden p-10 rounded-2xl shadow-lg"+ style={{+ background:+ "linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #0ea5e9 100%)",+ }}+ >+ <div+ id="blog-cloud-1"+ className="absolute top-0 -right-20 opacity-30 z-0 pointer-events-none transition-transform duration-700 ease-in-out"+ >+ <img+ className="max-w-[40vw] h-auto"+ src="/illustrations/cloud-1.png"+ alt="CTA Cloud One"+ />+ </div>+ <div+ id="blog-cloud-2"+ className="absolute bottom-0 left-0 opacity-30 z-0 pointer-events-none transition-transform duration-700 ease-in-out"+ >+ <img+ className="max-w-[40vw] h-auto"+ src="/illustrations/cloud-2.png"+ alt="CTA Cloud Two"+ />+ </div>+ <div className="relative z-10">+ <h2 className="text-3xl font-bold mb-4 text-white">+ {content.cta.title}+ </h2>+ <p className="text-xl mb-8 text-white/90">+ {content.cta.description}+ </p>+ <div className="inline-flex">+ <Button+ href={content.cta.buttonLink}+ variant="white"+ size="lg"+ className="px-8 py-3 text-blue-600 shadow-lg hover:shadow-xl transform hover:-translate-y-1 transition-all duration-300"+ >+ {content.cta.buttonText}+ </Button>+ </div>+ </div>+ </div>+ </section>++ {/* Related Links */}+ {content.relatedLinks && content.relatedLinks.length > 0 && (+ <div className="text-center text-gray-600 italic">+ Check out{" "}+ {(() => {+ const links = content.relatedLinks;+ return links.map((link, index) => (+ <span key={index}>+ <Link+ href={link.url}+ className="text-blue-600 hover:underline transition-colors"+ >+ {link.text}+ </Link>+ {index < links.length - 1 ? " or " : ""}+ </span>+ ));+ })()}+ .+ </div>+ )}++ <style jsx global>{`+ @keyframes fade-in-down {+ 0% {+ opacity: 0;+ transform: translateY(-10px);+ }+ 100% {+ opacity: 1;+ transform: translateY(0);+ }+ }++ @keyframes fade-in-up {+ 0% {+ opacity: 0;+ transform: translateY(10px);+ }+ 100% {+ opacity: 1;+ transform: translateY(0);+ }+ }++ .fade-in-down {+ animation: fade-in-down 0.8s ease-out forwards;+ }++ .fade-in-up {+ animation: fade-in-up 0.8s ease-out forwards;+ }++ .animate-delay-1 {+ animation-delay: 0.1s;+ }++ .animate-delay-2 {+ animation-delay: 0.2s;+ }+ `}</style>+ </article>+ );+};diff --git a/apps/web/components/blog/RecordScreenMacStructuredData.tsx b/apps/web/components/blog/RecordScreenMacStructuredData.tsxnew file mode 100644index 000000000..635f9d3a5--- /dev/null+++ b/apps/web/components/blog/RecordScreenMacStructuredData.tsx@@ -0,0 +1,62 @@+"use client";++import Script from "next/script";+import { recordScreenMacContent } from "../../content/blog-content/record-screen-mac-system-audio";++// Create Article structured data for SEO+const createArticleStructuredData = () => {+ const articleStructuredData = {+ "@context": "https://schema.org",+ "@type": "BlogPosting",+ headline: recordScreenMacContent.title,+ description: recordScreenMacContent.description,+ author: {+ "@type": "Person",+ name: recordScreenMacContent.author,+ },+ datePublished: recordScreenMacContent.publishedAt,+ image: recordScreenMacContent.videoDemo?.videoSrc,+ keywords: recordScreenMacContent.tags.join(","),+ mainEntityOfPage: {+ "@type": "WebPage",+ "@id": "https://cap.so/blog/record-screen-mac-system-audio",+ },+ };++ return JSON.stringify(articleStructuredData);+};++// Create FAQ structured data for SEO+const createFaqStructuredData = () => {+ const faqStructuredData = {+ "@context": "https://schema.org",+ "@type": "FAQPage",+ mainEntity: recordScreenMacContent.faqs.map((faq) => ({+ "@type": "Question",+ name: faq.question,+ acceptedAnswer: {+ "@type": "Answer",+ text: faq.answer.replace(/<\/?[^>]+(>|$)/g, ""),+ },+ })),+ };++ return JSON.stringify(faqStructuredData);+};++export const RecordScreenMacStructuredData = () => {+ return (+ <>+ <Script+ id="article-structured-data"+ type="application/ld+json"+ dangerouslySetInnerHTML={{ __html: createArticleStructuredData() }}+ />+ <Script+ id="faq-structured-data"+ type="application/ld+json"+ dangerouslySetInnerHTML={{ __html: createFaqStructuredData() }}+ />+ </>+ );+};diff --git a/apps/web/components/pages/UpdatesPage.tsx b/apps/web/components/pages/UpdatesPage.tsxindex 203709abf..68d0de288 100644--- a/apps/web/components/pages/UpdatesPage.tsx+++ b/apps/web/components/pages/UpdatesPage.tsx@@ -1,10 +1,10 @@import Link from "next/link";import Image from "next/image";import { format, parseISO } from "date-fns";-import { getBlogPosts } from "@/utils/blog";+import { getBlogPosts, PostMetadata, BlogPost } from "@/utils/blog";export const UpdatesPage = () => {- const allUpdates = getBlogPosts();+ const allUpdates = getBlogPosts() as BlogPost[];return (<div className="py-32 wrapper wrapper-sm">@@ -21,7 +21,7 @@ export const UpdatesPage = () => {key={post.slug}className="overflow-hidden w-full rounded-xl border">- <Link href={"/blog/" + post.slug}>+ <Link href={`/blog/${post.slug}`}>{post.metadata.image && (<div className="w-full border-b"><Image@@ -39,24 +39,35 @@ export const UpdatesPage = () => {{post.metadata.title}</h2><div className="flex space-x-2">- <p className="text-gray-600">by {post.metadata.author}</p>- <span>{` β’ `}</span>- <p className="text-gray-600">- {format(- parseISO(post.metadata.publishedAt),- "MMMM dd, yyyy"- )}- </p>+ {"author" in post.metadata && (+ <>+ <p className="text-gray-600">+ by {(post.metadata as PostMetadata).author}+ </p>+ <span>{` β’ `}</span>+ </>+ )}+ {"publishedAt" in post.metadata && (+ <p className="text-gray-600">+ {format(+ parseISO(+ (post.metadata as PostMetadata).publishedAt+ ),+ "MMMM dd, yyyy"+ )}+ </p>+ )}</div>- <div className="flex space-x-2">+ <div className="flex flex-wrap gap-2">{post.metadata.tags &&- post.metadata.tags- .split(", ")- .map((tag) => (- <p className="rounded-md bg-gray-200 font-medium px-2 py-0.5 text-sm text-gray-500">- {tag}- </p>- ))}+ post.metadata.tags.split(", ").map((tag, index) => (+ <p+ key={index}+ className="rounded-md bg-gray-200 font-medium px-2 py-0.5 text-sm text-gray-500"+ >+ {tag}+ </p>+ ))}</div></div></Link>diff --git a/apps/web/content/blog-content/record-screen-mac-system-audio.tsx b/apps/web/content/blog-content/record-screen-mac-system-audio.tsxnew file mode 100644index 000000000..c40bd30f1--- /dev/null+++ b/apps/web/content/blog-content/record-screen-mac-system-audio.tsx@@ -0,0 +1,208 @@+export const recordScreenMacContent = {+ title: "Record Screen + System Audio on Mac (Free, 2025 Guide)",+ description:+ "A simple guide to capturing your Mac screen with internal audio without complex audio routing or expensive software.",+ publishedAt: "2025-04-22",+ category: "Tutorials",+ author: "Richie McIlroy",+ tags: ["Screen Recording", "Mac", "System Audio", "Tutorials"],++ heroTLDR:+ "Want to record your Mac screen with internal audio without expensive software? Here's how to do it in 2 clicks with Capβcompletely free, no audio routing hacks needed.",++ comparisonTable: {+ title: "4 Ways to Capture System Audio on macOS",+ headers: ["Method", "Price", "Complexity", "Notes"],+ rows: [+ [+ "<strong>Cap</strong>",+ "Free (open-source)",+ '<span className="rating">β ββββ</span> (2 clicks)',+ "Works on all macOS versions including Sonoma, M-series chips",+ ],+ [+ "<strong>QuickTime + BlackHole</strong>",+ "Free but technical",+ '<span className="rating">β β β β β</span>',+ "Requires terminal commands, audio MIDI setup",+ ],+ [+ "<strong>OBS</strong>",+ "Free but complex",+ '<span className="rating">β β β ββ</span>',+ "Large app, needs BlackHole for audio",+ ],+ [+ "<strong>Loopback</strong>",+ "$99",+ '<span className="rating">β β βββ</span>',+ "Professional solution, but expensive",+ ],+ ],+ },++ methods: [+ {+ title: "Method 1: Cap (2-Click Tutorial)",+ description:+ "Cap makes it ridiculously simple to record your Mac screen with system audio:",+ steps: [+ {+ title: "Step 1: Install Cap",+ content:+ 'Download and install Cap from <a href="/download">Cap.so/download</a>.',+ },+ {+ title: "Step 2: Start a Recording",+ content: `+ <ol>+ <li>Click the Cap icon in your menu bar</li>+ <li>Toggle "No System Audio" to "Record System Audio"</li>+ <li>Select the screen area you want to capture</li>+ <li>Click "Start Recording"</li>+ </ol>+ <p>That's it! Cap now captures both your screen and all system audio without any complex setup.</p>+ <p><strong>Pro Tip:</strong> Cap works without kernel extensions and is fully compatible with macOS Sonoma and all M-series chips.</p>+ `,+ },+ {+ title: "Step 3: Edit and Share (Optional)",+ content: `+ <p>After recording:</p>+ <ul>+ <li>Trim unwanted sections with Cap's built-in editor</li>+ <li>Adjust audio channels individually - control microphone and system audio levels separately</li>+ <li>Increase or decrease dB gain to make audio louder or quieter as needed</li>+ <li>Add custom backgrounds or padding if needed</li>+ <li>Get a shareable link with one click</li>+ </ul>+ `,+ },+ ],+ },+ {+ title: "Method 2: Built-in QuickTime + BlackHole",+ description:+ "If you prefer using Apple's built-in tools, you'll need to:",+ steps: [+ {+ content: `+ <ol>+ <li>Install BlackHole audio driver via Terminal: <code>brew install blackhole-2ch</code></li>+ <li>Open Audio MIDI Setup and create a Multi-Output Device</li>+ <li>Configure QuickTime to use BlackHole as input</li>+ <li>Remember to switch your audio setup back when done</li>+ </ol>+ <p><strong>Skip the hacks and try Cap instead</strong> β no audio configuration required.</p>+ `,+ },+ ],+ },+ ],++ troubleshooting: {+ title: "Troubleshooting System Audio Recording",+ items: [+ {+ question: "I hear echo or feedback in my recording",+ answer:+ 'This typically happens when both microphone and system audio are being recorded. In Cap, make sure only "Record System Audio" is enabled if you don\'t need microphone input.',+ },+ {+ question: "My microphone is muted during system audio recording",+ answer:+ "Cap allows recording both system audio and microphone simultaneously. Toggle both options ON in the recording menu.",+ },+ {+ question: "FaceTime/Zoom audio isn't being captured",+ answer:+ 'Some apps have special privacy protections. In Cap, make sure to select "Record entire screen" to capture protected app audio.',+ },+ {+ question: "System audio recording stopped working after update",+ answer:+ "After macOS updates, you may need to re-authorize screen recording permissions. Go to System Preferences β Security & Privacy β Privacy β Screen Recording and ensure Cap is checked.",+ },+ ],+ },++ proTips: {+ title: "Pro Tips for Client Demos and Content Creators",+ tips: [+ {+ title: "60 FPS Recording",+ description:+ "Enable high frame rate recording in Cap settings for smoother demos of animations and transitions.",+ },+ {+ title: "Audio Channel Control",+ description:+ "Fine-tune your recording's audio by adjusting microphone and system audio levels independently. Increase dB gain for quiet audio or reduce it to prevent distortion.",+ },+ {+ title: "Auto-Subtitles",+ description:+ "Cap can automatically generate captions for your recording, making content more accessible.",+ },+ {+ title: "Custom Sharing",+ description:+ "Use Cap.link or set up your own custom domain for a branded sharing experience.",+ },+ ],+ },++ videoDemo: {+ title: "See It in Action",+ videoSrc: "https://cap.link/video/system-audio-demo.mp4",+ caption: "Cap recording Mac screen with system audio in 2 clicks",+ },++ faqs: [+ {+ question: "Does this work on M1, M2, and M3 Macs?",+ answer:+ "Yes, Cap is fully optimized for all Apple Silicon chips, including M1, M2, and M3 series processors.",+ },+ {+ question: "Will recording system audio affect my computer's performance?",+ answer:+ "Cap is designed to be extremely lightweight. You'll experience minimal performance impact even when recording high-resolution screens with system audio.",+ },+ {+ question: "Can I record specific application audio only?",+ answer:+ "Currently, macOS doesn't provide an API for app-specific audio capture. Cap records all system audio, but you can easily edit out unwanted sections afterward.",+ },+ {+ question: "Is there a time limit for recordings with system audio?",+ answer:+ "Cap's free version has no time limits on recordings. Record as long as you need.",+ },+ {+ question: "Can I record system audio on multiple monitors?",+ answer:+ "Yes, Cap can record system audio while capturing a single monitor, multiple monitors, or just a portion of your screen.",+ },+ ],+ cta: {+ title: "Start Recording with System Audio Today",+ description:+ "Cap makes recording your Mac screen with system audio incredibly simple. No complex audio routing, no expensive software.",+ buttonText: "Download Cap",+ buttonLink: "/download",+ subtitle:+ "Download Cap for macOS β free forever β’ Open-source β’ 14-day Pro trial",+ },++ relatedLinks: [+ {+ text: "Cap vs Loom",+ url: "/loom-alternative",+ },+ {+ text: "Screen Recording Software",+ url: "/screen-recording-software",+ },+ ],+};diff --git a/apps/web/lib/utils.ts b/apps/web/lib/utils.tsnew file mode 100644index 000000000..106f843f6--- /dev/null+++ b/apps/web/lib/utils.ts@@ -0,0 +1,13 @@+/**+ * Format a date string to a more readable format+ * @param dateString - ISO 8601 date string+ * @returns Formatted date string (e.g., October 1, 2024)+ */+export function formatDate(dateString: string): string {+ const date = new Date(dateString);+ return date.toLocaleDateString("en-US", {+ year: "numeric",+ month: "long",+ day: "numeric",+ });+}\ No newline at end of filediff --git a/apps/web/utils/blog.ts b/apps/web/utils/blog.tsindex af57c7f4e..6a13a1bab 100644--- a/apps/web/utils/blog.ts+++ b/apps/web/utils/blog.ts@@ -19,6 +19,13 @@ export type DocMetadata = {image?: string;};+export interface BlogPost {+ metadata: PostMetadata | DocMetadata;+ slug: string;+ content: string;+ isManual?: boolean;+}+function parseFrontmatter(fileContent: string) {let frontmatterRegex = /---\s*([\s\S]*?)\s*---/;let match = frontmatterRegex.exec(fileContent);@@ -77,7 +84,7 @@ function readMDXFile(filePath: string) {return parseFrontmatter(rawContent);}-function getMDXData(dir: string) {+function getMDXData(dir: string): BlogPost[] {console.log("Getting MDX data from:", dir);let mdxFiles = getMDXFiles(dir);return mdxFiles.map((relativePath) => {@@ -94,12 +101,84 @@ function getMDXData(dir: string) {metadata,slug,content,+ isManual: false};});}-export function getBlogPosts() {- return getMDXData(path.join(process.cwd(), "content/blog"));+export function getManualBlogPosts(): BlogPost[] {+ try {+ const blogContentDir = path.join(process.cwd(), "content/blog-content");+ if (!fs.existsSync(blogContentDir)) {+ console.log("Blog content directory does not exist:", blogContentDir);+ return [];+ }++ const fileNames = fs.readdirSync(blogContentDir);++ return fileNames+ .filter(fileName => fileName.endsWith('.tsx'))+ .map(fileName => {+ const slug = fileName.replace(/\.tsx$/, "");++ try {+ const filePath = path.join(blogContentDir, fileName);+ const fileContent = fs.readFileSync(filePath, 'utf8');++ // Extract metadata using regex - ensure we have defaults for all required fields+ const getRegexValue = (regex: RegExp, defaultValue: string): string => {+ const match = fileContent.match(regex);+ return match && match[1] ? match[1] : defaultValue;+ };++ const title = getRegexValue(/title:\s*"([^"]+)"/, `Unknown (${slug})`);+ const description = getRegexValue(/description:\s*"([^"]+)"/, `Blog post about ${slug}`);+ const publishedAt = getRegexValue(/publishedAt:\s*"([^"]+)"/, new Date().toISOString());+ const author = getRegexValue(/author:\s*"([^"]+)"/, 'Cap Team');++ // Tags handling+ const tagsMatch = fileContent.match(/tags:\s*\[(.*?)\]/);+ let tags = '';+ if (tagsMatch && tagsMatch[1]) {+ tags = tagsMatch[1]+ .split(',')+ .map(tag => tag.trim().replace(/"/g, ''))+ .join(', ');+ }++ // Create a metadata object similar to MDX files+ const metadata: PostMetadata = {+ title,+ description,+ publishedAt,+ author,+ summary: description,+ tags+ };++ return {+ metadata,+ slug,+ content: '', // Content is handled by the component specific to this manual post+ isManual: true+ } as BlogPost;+ } catch (error) {+ console.error(`Error processing manual blog post ${fileName}:`, error);+ return null;+ }+ })+ .filter((post): post is BlogPost => post !== null); // Type guard to filter out nulls+ } catch (error) {+ console.error("Error getting manual blog posts:", error);+ return [];+ }+}++export function getBlogPosts(): BlogPost[] {+ const mdxPosts = getMDXData(path.join(process.cwd(), "content/blog"));+ const manualPosts = getManualBlogPosts();++ return [...mdxPosts, ...manualPosts];}export function getDocs() {