Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Refactor blog system for interactive content support (#1023)
Richie McIlroye21390702fe1
diff --git a/apps/web/app/(site)/blog/[slug]/page.tsx b/apps/web/app/(site)/blog/[slug]/page.tsxindex 4fc242930..048b77711 100644--- a/apps/web/app/(site)/blog/[slug]/page.tsx+++ b/apps/web/app/(site)/blog/[slug]/page.tsx@@ -4,8 +4,13 @@ import type { Metadata } from "next";import Image from "next/image";import { notFound } from "next/navigation";import { MDXRemote } from "next-mdx-remote/rsc";+import { BlogTemplate } from "@/components/blog/BlogTemplate";import { ReadyToGetStarted } from "@/components/ReadyToGetStarted";import { getBlogPosts } from "@/utils/blog";+import {+ getInteractiveBlogContent,+ isInteractiveBlogPost,+} from "@/utils/blog-registry";import { calculateReadingTime } from "@/utils/readTime";import { Share } from "../_components/Share";@@ -67,6 +72,11 @@ export default async function PostPage({ params }: PostProps) {notFound();}+ if (isInteractiveBlogPost(params.slug)) {+ const interactiveContent = getInteractiveBlogContent(params.slug);+ return <BlogTemplate content={interactiveContent} />;+ }+const readingTime = calculateReadingTime(post.content);return (diff --git a/apps/web/app/(site)/blog/record-screen-mac-system-audio/page.tsx b/apps/web/app/(site)/blog/record-screen-mac-system-audio/page.tsxdeleted file mode 100644index 9933ce8fa..000000000--- a/apps/web/app/(site)/blog/record-screen-mac-system-audio/page.tsx+++ /dev/null@@ -1,18 +0,0 @@-import type { Metadata } from "next";-import { recordScreenMacContent } from "@/app/../content/blog-content/record-screen-mac-system-audio";-import { BlogTemplate } from "@/components/blog/BlogTemplate";-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/blog/BlogTemplate.tsx b/apps/web/components/blog/BlogTemplate.tsxindex 469b92d88..6476c87f2 100644--- a/apps/web/components/blog/BlogTemplate.tsx+++ b/apps/web/components/blog/BlogTemplate.tsx@@ -2,9 +2,11 @@import { Button } from "@cap/ui";import MuxPlayer from "@mux/mux-player-react";+import Image from "next/image";import Link from "next/link";-import { useEffect } from "react";+import { useEffect, useId } from "react";import { formatDate } from "../../lib/utils";+import { generateGradientFromSlug } from "../../utils/gradients";interface BlogPost {title: string;@@ -15,6 +17,8 @@ interface BlogPost {author: string;tags: string[];heroTLDR: string;+ slug: string;+ gradientColors?: string[];comparisonTable?: {title: string;headers: string[];@@ -75,14 +79,22 @@ const renderHTML = (content: string) => {'<a class="font-semibold text-blue-500 transition-colors hover:text-blue-600" ',);- return <div dangerouslySetInnerHTML={{ __html: styledContent }} />;+ return (+ <div+ className="prose prose-lg"+ dangerouslySetInnerHTML={{ __html: styledContent }}+ />+ );};export const BlogTemplate = ({ content }: { content: BlogPost }) => {+ const cloud1Id = useId();+ const cloud2Id = useId();+useEffect(() => {const animateClouds = () => {- const cloud1 = document.getElementById("blog-cloud-1");- const cloud2 = document.getElementById("blog-cloud-2");+ const cloud1 = document.getElementById(cloud1Id);+ const cloud2 = document.getElementById(cloud2Id);if (cloud1 && cloud2) {cloud1.animate(@@ -116,11 +128,10 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {};animateClouds();- }, []);+ }, [cloud1Id, cloud2Id]);return (<article className="relative z-10 px-3 py-32 mx-auto max-w-3xl md:py-40">- {/* Header */}<header className="mb-16 text-center"><div className="mb-4 text-sm font-medium text-blue-600 fade-in-down">{content.category}@@ -140,19 +151,7 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</div></header>- {/* Featured Image */}- {content.image && (- <div className="overflow-hidden mb-12 rounded-xl shadow-xl transition-all duration-300 transform hover:-translate-y-1">- <img- src={content.image}- alt={content.title}- className="object-cover w-full h-auto"- />- </div>- )}-- {/* Hero TL;DR */}- <div className="p-8 mb-12 bg-blue-50 rounded-xl border border-blue-100 shadow-md transition-all duration-300 transform hover:shadow-xl hover:-translate-y-1">+ <div className="p-8 mb-12 bg-blue-50 rounded-xl border border-blue-100 shadow-md"><h2 className="inline-block relative mb-4 text-2xl font-medium text-gray-900">TL;DR<span className="absolute left-0 -bottom-1 w-16 h-1 bg-blue-500 rounded-full"></span>@@ -163,14 +162,13 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {href={content.cta.buttonLink}size="lg"variant="blue"- className="px-6 py-3 shadow-lg transition-all duration-300 transform hover:shadow-xl hover:-translate-y-1"+ className="px-6 py-3 shadow-lg">{content.cta.buttonText}</Button></div></div>- {/* Comparison Table */}{content.comparisonTable && (<section className="mb-16"><h2 className="inline-block relative mb-8 text-3xl font-medium text-gray-900">@@ -179,28 +177,30 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</h2><div className="overflow-x-auto">- <table className="overflow-hidden w-full rounded-lg shadow-md border-collapse transition-all duration-300 hover:shadow-lg">+ <table className="overflow-hidden w-full rounded-lg shadow-md border-collapse"><thead className="bg-blue-50"><tr>- {content.comparisonTable.headers.map((header, index) => (- <th- key={index}- className="px-6 py-4 font-semibold text-left text-gray-700 border-b border-gray-200"- >- {header}- </th>- ))}+ {content.comparisonTable.headers.map(+ (header, headerIndex) => (+ <th+ key={`header-${headerIndex}-${header}`}+ className="px-6 py-4 font-semibold text-left text-gray-700 border-b border-gray-200"+ >+ {header}+ </th>+ ),+ )}</tr></thead><tbody>{content.comparisonTable.rows.map((row, rowIndex) => (<tr- key={rowIndex}+ key={`row-${rowIndex}`}className={rowIndex % 2 === 0 ? "bg-gray-1" : "bg-gray-50"}>{row.map((cell, cellIndex) => (<td- key={cellIndex}+ key={`cell-${rowIndex}-${cellIndex}`}className="px-6 py-4 border-b border-gray-200"dangerouslySetInnerHTML={{ __html: cell }}/>@@ -213,35 +213,33 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</section>)}- {/* Methods */}- {content.methods &&- content.methods.map((method, index) => (- <section key={index} className="mb-16">- <h2 className="inline-block relative mb-6 text-3xl font-medium text-gray-900">- {method.title}- <span className="absolute -bottom-2 left-1/2 w-20 h-1 bg-blue-500 rounded-full transform -translate-x-1/2"></span>- </h2>- <p className="mb-8 text-xl text-gray-700">{method.description}</p>-- {method.steps.map((step, stepIndex) => (- <div- key={stepIndex}- className="p-6 mb-8 rounded-xl border border-gray-100 shadow-md transition-all duration-300 transform bg-gray-1 hover:shadow-xl hover:border-blue-100 hover:-translate-y-1"- >- {step.title && (- <h3 className="mb-4 text-2xl font-semibold text-gray-800">- {step.title}- </h3>- )}- <div className="max-w-none prose prose-lg">- {renderHTML(step.content)}- </div>- </div>- ))}- </section>- ))}+ {content.methods?.map((method, methodIndex) => (+ <section+ key={`method-${methodIndex}-${method.title}`}+ className="mb-16"+ >+ <h2 className="inline-block relative mb-6 text-3xl font-medium text-gray-900">+ {method.title}+ <span className="absolute -bottom-2 left-1/2 w-20 h-1 bg-blue-500 rounded-full transform -translate-x-1/2"></span>+ </h2>+ <p className="mb-8 text-xl text-gray-700">{method.description}</p>++ {method.steps.map((step, stepIndex) => (+ <div+ key={`step-${methodIndex}-${stepIndex}`}+ className="p-6 mb-8 rounded-xl border border-gray-100 shadow-md bg-gray-1"+ >+ {step.title && (+ <h3 className="mb-4 text-2xl font-semibold text-gray-800">+ {step.title}+ </h3>+ )}+ {renderHTML(step.content)}+ </div>+ ))}+ </section>+ ))}- {/* Troubleshooting */}{content.troubleshooting && (<section className="mb-16"><h2 className="inline-block relative mb-8 text-3xl font-medium text-gray-900">@@ -250,10 +248,10 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</h2><div className="space-y-4">- {content.troubleshooting.items.map((item, index) => (+ {content.troubleshooting.items.map((item, itemIndex) => (<details- key={index}- className="p-6 rounded-xl border border-gray-100 shadow-md transition-all duration-300 bg-gray-1 hover:shadow-xl hover:border-blue-100"+ key={`trouble-${itemIndex}-${item.question.slice(0, 20)}`}+ className="p-6 rounded-xl border border-gray-100 shadow-md bg-gray-1"><summary className="text-xl font-semibold text-gray-800 cursor-pointer">{item.question}@@ -265,7 +263,6 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</section>)}- {/* Pro Tips */}{content.proTips && (<section className="mb-16"><h2 className="inline-block relative mb-8 text-3xl font-medium text-gray-900">@@ -274,10 +271,10 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</h2><div className="grid grid-cols-1 gap-6 md:grid-cols-3">- {content.proTips.tips.map((tip, index) => (+ {content.proTips.tips.map((tip, tipIndex) => (<div- key={index}- className="p-6 bg-blue-50 rounded-xl border border-blue-100 shadow-md transition-all duration-300 transform hover:shadow-xl hover:-translate-y-1"+ key={`tip-${tipIndex}-${tip.title}`}+ className="p-6 bg-blue-50 rounded-xl border border-blue-100 shadow-md"><h3 className="mb-3 text-xl font-semibold text-blue-800">πΉ {tip.title}@@ -289,7 +286,6 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</section>)}- {/* Video Demo */}{content.videoDemo && (<section className="mb-16"><h2 className="inline-block relative mb-6 text-3xl font-medium text-gray-900">@@ -297,7 +293,7 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {<span className="absolute -bottom-2 left-1/2 w-20 h-1 bg-blue-500 rounded-full transform -translate-x-1/2"></span></h2>- <figure className="overflow-hidden rounded-xl shadow-lg transition-all duration-300 transform hover:shadow-xl hover:-translate-y-1">+ <figure className="overflow-hidden rounded-xl shadow-lg"><MuxPlayerplaybackId="A6oZoUWVZjOIVZB6XnBMLagYnXE6xhDhp8Hcyky018hk"metadataVideoTitle="Cap Demo"@@ -308,7 +304,6 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</section>)}- {/* FAQs */}{content.faqs && (<section className="mb-16"><h2 className="inline-block relative mb-8 text-3xl font-medium text-gray-900">@@ -317,10 +312,10 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</h2><div className="space-y-4">- {content.faqs.map((faq, index) => (+ {content.faqs.map((faq, faqIndex) => (<details- key={index}- className="p-6 rounded-xl border border-gray-100 shadow-md transition-all duration-300 bg-gray-1 hover:shadow-xl hover:border-blue-100"+ key={`faq-${faqIndex}-${faq.question.slice(0, 20)}`}+ className="p-6 rounded-xl border border-gray-100 shadow-md bg-gray-1"><summary className="text-xl font-semibold text-gray-800 cursor-pointer">{faq.question}@@ -332,7 +327,6 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</section>)}- {/* Testimonial */}{content.testimonial && (<section className="mb-16"><h2 className="inline-block relative mb-8 text-3xl font-medium text-gray-900">@@ -340,14 +334,16 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {<span className="absolute -bottom-2 left-1/2 w-20 h-1 bg-blue-500 rounded-full transform -translate-x-1/2"></span></h2>- <blockquote className="p-8 rounded-xl border-l-4 border-blue-500 shadow-md transition-all duration-300 transform bg-gray-1 hover:shadow-xl hover:-translate-y-1">+ <blockquote className="p-8 rounded-xl border-l-4 border-blue-500 shadow-md bg-gray-1"><p className="mb-6 text-xl italic text-gray-700">"{content.testimonial.quote}"</p><footer className="flex items-center">- <img+ <Imagesrc={content.testimonial.avatar}alt={content.testimonial.author}+ width={48}+ height={48}className="mr-4 w-12 h-12 rounded-full"/><cite className="not-italic font-medium text-gray-900">@@ -358,7 +354,6 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</section>)}- {/* CTA Section */}<section className="mb-16"><divclassName="overflow-hidden relative p-10 rounded-2xl shadow-lg"@@ -368,23 +363,27 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {}}><div- id="blog-cloud-1"+ id={cloud1Id}className="absolute top-0 -right-20 z-0 opacity-30 transition-transform duration-700 ease-in-out pointer-events-none">- <img+ <ImageclassName="max-w-[40vw] h-auto"src="/illustrations/cloud-1.png"alt="CTA Cloud One"+ width={400}+ height={300}/></div><div- id="blog-cloud-2"+ id={cloud2Id}className="absolute bottom-0 left-0 z-0 opacity-30 transition-transform duration-700 ease-in-out pointer-events-none">- <img+ <ImageclassName="max-w-[40vw] h-auto"src="/illustrations/cloud-2.png"alt="CTA Cloud Two"+ width={400}+ height={300}/></div><div className="relative z-10">@@ -399,7 +398,7 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {href={content.cta.buttonLink}variant="white"size="lg"- className="px-8 py-3 text-blue-600 shadow-lg transition-all duration-300 transform hover:shadow-xl hover:-translate-y-1"+ className="px-8 py-3 text-blue-600 shadow-lg">{content.cta.buttonText}</Button>@@ -408,20 +407,19 @@ export const BlogTemplate = ({ content }: { content: BlogPost }) => {</div></section>- {/* Related Links */}{content.relatedLinks && content.relatedLinks.length > 0 && (<div className="italic text-center text-gray-600">Check out {(() => {const links = content.relatedLinks;- return links.map((link, index) => (- <span key={index}>+ return links.map((link, linkIndex) => (+ <span key={`link-${linkIndex}-${link.url}`}><Linkhref={link.url}className="text-blue-600 transition-colors hover:underline">{link.text}</Link>- {index < links.length - 1 ? " or " : ""}+ {linkIndex < links.length - 1 ? " or " : ""}</span>));})()}.diff --git a/apps/web/components/pages/UpdatesPage.tsx b/apps/web/components/pages/UpdatesPage.tsxindex 4168c9879..23428f8d1 100644--- a/apps/web/components/pages/UpdatesPage.tsx+++ b/apps/web/components/pages/UpdatesPage.tsx@@ -2,6 +2,11 @@ import { format, parseISO } from "date-fns";import Image from "next/image";import Link from "next/link";import { type BlogPost, getBlogPosts, type PostMetadata } from "@/utils/blog";+import {+ getInteractiveBlogContent,+ isInteractiveBlogPost,+} from "@/utils/blog-registry";+import { generateGradientFromSlug } from "@/utils/gradients";const FEATURED_SLUGS = ["handling-a-stripe-payment-attack", "cap-v03-launch"];@@ -10,7 +15,6 @@ export const UpdatesPage = () => {const featuredPosts = allUpdates.filter((post) => FEATURED_SLUGS.includes(post.slug))- // Sort featured posts by date (newest first).sort((a, b) => {if ("publishedAt" in a.metadata && "publishedAt" in b.metadata) {return (@@ -24,7 +28,6 @@ export const UpdatesPage = () => {const remainingPosts = allUpdates.filter((post) => !FEATURED_SLUGS.includes(post.slug)).sort((a, b) => {- // Sort by published date in descending orderif ("publishedAt" in a.metadata && "publishedAt" in b.metadata) {return (new Date(b.metadata.publishedAt).getTime() -@@ -45,7 +48,7 @@ export const UpdatesPage = () => {className="overflow-hidden w-full rounded-xl border transition-shadow bg-gray-1 border-gray-5 hover:shadow-md"><Link href={`/blog/${post.slug}`}>- {post.metadata.image && (+ {post.metadata.image ? (<div className="w-full border-b"><Imagesrc={post.metadata.image}@@ -56,7 +59,24 @@ export const UpdatesPage = () => {className="object-cover w-full h-48"/></div>- )}+ ) : isInteractiveBlogPost(post.slug) ? (+ (() => {+ const interactiveContent = getInteractiveBlogContent(+ post.slug,+ );+ return (+ <div+ className="w-full h-48 border-b"+ style={{+ background: generateGradientFromSlug(+ post.slug,+ interactiveContent.gradientColors,+ ),+ }}+ />+ );+ })()+ ) : null}<div className="p-6 space-y-3"><h3 className="text-xl font-semibold text-gray-12">{post.metadata.title}@@ -101,14 +121,14 @@ export const UpdatesPage = () => {)}<div>- <div className="space-y-8">+ <div className="grid grid-cols-1 gap-6 md:grid-cols-2">{remainingPosts.map((post) => (<articlekey={post.slug}- className="overflow-hidden w-full rounded-xl border bg-gray-1 border-gray-5"+ className="overflow-hidden w-full rounded-xl border transition-shadow bg-gray-1 border-gray-5 hover:shadow-md"><Link href={`/blog/${post.slug}`}>- {post.metadata.image && (+ {post.metadata.image ? (<div className="w-full border-b"><Imagesrc={post.metadata.image}@@ -116,15 +136,32 @@ export const UpdatesPage = () => {height={400}objectFit="cover"alt={post.metadata.title}- className="w-full h-auto"+ className="object-cover w-full h-48"/></div>- )}- <div className="p-10 space-y-4">- <h2 className="text-xl text-gray-12 md:text-4xl">+ ) : isInteractiveBlogPost(post.slug) ? (+ (() => {+ const interactiveContent = getInteractiveBlogContent(+ post.slug,+ );+ return (+ <div+ className="w-full h-48 border-b"+ style={{+ background: generateGradientFromSlug(+ post.slug,+ interactiveContent.gradientColors,+ ),+ }}+ />+ );+ })()+ ) : null}+ <div className="p-6 space-y-3">+ <h3 className="text-xl font-semibold text-gray-12">{post.metadata.title}- </h2>- <div className="flex space-x-2">+ </h3>+ <div className="flex space-x-2 text-sm">{"author" in post.metadata && (<><p className="text-gray-10">@@ -143,15 +180,14 @@ export const UpdatesPage = () => {)}</div><div className="flex flex-wrap gap-2">- {post.metadata.tags &&- post.metadata.tags.split(", ").map((tag, index) => (- <p- key={index}- className="rounded-md bg-gray-3 font-medium px-2 py-0.5 text-sm text-gray-12"- >- {tag}- </p>- ))}+ {post.metadata.tags?.split(", ").map((tag, index) => (+ <p+ key={index}+ className="rounded-md bg-gray-3 font-medium px-2 py-0.5 text-sm text-gray-12"+ >+ {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.tsxindex 060415928..f634d3b7a 100644--- a/apps/web/content/blog-content/record-screen-mac-system-audio.tsx+++ b/apps/web/content/blog-content/record-screen-mac-system-audio.tsx@@ -7,6 +7,7 @@ export const recordScreenMacContent = {category: "Tutorials",author: "Richie McIlroy",tags: ["Screen Recording", "Mac", "System Audio", "Tutorials"],+ gradientColors: ["#fed7aa", "#fdba74", "#fb923c"], // pastel oranges/yellows for macOS Big SurheroTLDR:"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.",diff --git a/apps/web/content/blog-content/windows-11-record-screen-system-audio-no-stereo-mix.tsx b/apps/web/content/blog-content/windows-11-record-screen-system-audio-no-stereo-mix.tsxnew file mode 100644index 000000000..ffd2088ae--- /dev/null+++ b/apps/web/content/blog-content/windows-11-record-screen-system-audio-no-stereo-mix.tsx@@ -0,0 +1,205 @@+export const recordScreenWindowsContent = {+ slug: "windows-11-record-screen-system-audio-no-stereo-mix",+ title: "Record Screen + System Audio on Windows 11 (No Stereo Mix)",+ description:+ "Learn how to record your screen with crisp internal audio on Windows 11βwithout Stereo Mix. Capture mic + system sound together using Cap. Step-by-step setup, fixes, and FAQs.",+ publishedAt: "2025-09-17",+ category: "Tutorials",+ author: "Cap Team",+ tags: ["Screen Recording", "Windows", "System Audio", "Tutorials"],+ gradientColors: ["#dbeafe", "#bfdbfe", "#93c5fd"],++ heroTLDR:+ "You don't need the old Stereo Mix device. Cap uses modern WASAPI loopback capture to record exactly what's playing through your speakers or headphones, plus your microphone, in just a couple of clicks.",++ comparisonTable: {+ title: "4 Ways to Capture System Audio on Windows 11",+ headers: ["Method", "Price", "Complexity", "Notes"],+ rows: [+ [+ "<strong>Cap</strong>",+ "Free (open-source)",+ '<span className="rating">β ββββ</span> (2 clicks)',+ "Uses WASAPI loopback, works on all Windows 11 versions",+ ],+ [+ "<strong>Xbox Game Bar</strong>",+ "Built-in Windows",+ '<span className="rating">β β βββ</span>',+ "Good for games, limited for desktop workflows",+ ],+ [+ "<strong>OBS</strong>",+ "Free but complex",+ '<span className="rating">β β β ββ</span>',+ "Powerful but requires audio setup knowledge",+ ],+ [+ "<strong>Stereo Mix Method</strong>",+ "Free but unreliable",+ '<span className="rating">β β β β β</span>',+ "Often unavailable on modern Windows 11 hardware",+ ],+ ],+ },++ methods: [+ {+ title: "Method 1: Cap (Fastest Path)",+ description:+ "Cap makes it simple to record your Windows screen with system audio using modern WASAPI loopback:",+ steps: [+ {+ title: "Step 1: Install Cap",+ content:+ 'Download and install Cap from <a href="/download">Cap.so/download</a>.',+ },+ {+ title: "Step 2: Configure Audio (1 Minute Setup)",+ content: `+ <p><strong>Pick Your Output Device:</strong></p>+ <p>Go to Settings β System β Sound and confirm which device you're actually using (speakers, headphones, etc.).</p>+ <p><strong>Check Per-App Audio Routing:</strong></p>+ <p>Go to Settings β System β Sound β Volume mixer. Make sure the app you plan to record (Chrome, Spotify, Teams, etc.) is set to output to the same device you're listening on.</p>+ `,+ },+ {+ title: "Step 3: Start Recording",+ content: `+ <ol>+ <li>Open Cap and choose your recording mode (Instant or Studio)</li>+ <li>Enable "Record System Audio" in the recording options</li>+ <li>Optionally enable "Microphone" for narration</li>+ <li>Choose your capture area (Screen, Window, or Region)</li>+ <li>Click "Start Recording"</li>+ </ol>+ <p><strong>Pro Tip:</strong> Cap captures both audio sources on separate tracks so you can adjust levels independently in the editor.</p>+ `,+ },+ ],+ },+ {+ title: "Method 2: Xbox Game Bar (Built-in Windows)",+ description:+ "Windows 11's built-in Game Bar can record system audio, but with limitations:",+ steps: [+ {+ content: `+ <ol>+ <li>Press Win+G to open Xbox Game Bar</li>+ <li>Go to Capture β Win+Alt+R to start/stop recording</li>+ <li>Toggle the mic icon for narration</li>+ </ol>+ <p><strong>Limitation:</strong> Game Bar is designed for recording games and app windows, not desktop workflows or File Explorer tutorials.</p>+ <p><strong>Use Cap instead</strong> for better control and desktop recording capabilities.</p>+ `,+ },+ ],+ },+ ],++ troubleshooting: {+ title: "Troubleshooting Common Audio Issues",+ items: [+ {+ question: "No desktop audio in recording",+ answer:+ "Check Volume mixer (Settings β System β Sound β Volume mixer) and verify the app's output is set to your active speakers or headset.",+ },+ {+ question: "Microphone not being captured",+ answer:+ 'Go to Control Panel β Sound β Recording β Microphone β Advanced, then uncheck "Allow applications to take exclusive control of this device."',+ },+ {+ question: "Recording is completely silent",+ answer:+ "Double-check the Volume mixer settings and confirm the app is playing to the output device Cap is monitoring. Cap captures from your default output device using WASAPI loopback.",+ },+ {+ question: "Can't find Stereo Mix on Windows 11",+ answer:+ "Many modern devices hide Stereo Mix or don't include it. You don't need itβCap uses WASAPI loopback to record internal audio directly from your default output device.",+ },+ ],+ },++ proTips: {+ title: "Pro Tips for Windows Screen Recording",+ tips: [+ {+ title: "Separate Audio Tracks",+ description:+ "Cap records system audio and microphone on separate tracks, allowing you to adjust levels independently in the editor.",+ },+ {+ title: "Monitor While Recording",+ description:+ "If you're wearing headphones, you can monitor your recording comfortably while capturing system audio without feedback loops.",+ },+ {+ title: "Auto-Subtitles",+ description:+ "Cap can automatically generate captions for your recording, making content more accessible.",+ },+ {+ title: "Privacy Compliance",+ description:+ "When recording meetings or calls, ensure you have everyone's consent and follow local privacy laws.",+ },+ ],+ },++ faqs: [+ {+ question: "Can I record mic and system audio at the same time?",+ answer:+ "Yes, absolutely. In Cap, enable both 'System Audio' and 'Microphone' in the recording options. Cap captures both on separate tracks so you can adjust levels independently in the editor.",+ },+ {+ question: "Why can't I find Stereo Mix on Windows 11?",+ answer:+ "Many modern devices hide Stereo Mix or don't include it at all in their drivers. The good news is you don't actually need it anymore. Cap uses WASAPI loopback to record internal audio directly from your default output device.",+ },+ {+ question: "Does Game Bar record everything on the desktop?",+ answer:+ "Not really. Game Bar is optimized for recording games and specific application windows, not general desktop activities or File Explorer workflows. For tutorial creation or full-desktop walkthroughs, dedicated tools like Cap give you much more control and better results.",+ },+ {+ question: "Will this work on older Windows versions?",+ answer:+ "Cap's WASAPI loopback capture works on Windows 10 and Windows 11. It's more reliable than the old Stereo Mix method across different hardware configurations.",+ },+ {+ question: "Can I record specific application audio only?",+ answer:+ "Windows doesn't provide easy app-specific audio capture, but you can control which apps output to which devices in Volume mixer, then record from that specific output device.",+ },+ ],++ cta: {+ title: "Start Recording with System Audio Today",+ description:+ "Cap makes recording your Windows screen with system audio incredibly simple. No Stereo Mix required, no complex audio routing.",+ buttonText: "Download Cap",+ buttonLink: "/download",+ subtitle:+ "Download Cap for Windows β free forever β’ Open-source β’ 14-day Pro trial",+ },++ relatedLinks: [+ {+ text: "Record Screen Mac System Audio",+ url: "/record-screen-mac-system-audio",+ },+ {+ text: "Video Trimmer Tool",+ url: "/tools/trim",+ },+ {+ text: "Speed Controller Tool",+ url: "/tools/speed",+ },+ ],+};diff --git a/apps/web/utils/blog-registry.ts b/apps/web/utils/blog-registry.tsnew file mode 100644index 000000000..e7975d503--- /dev/null+++ b/apps/web/utils/blog-registry.ts@@ -0,0 +1,27 @@+import { recordScreenMacContent } from "../content/blog-content/record-screen-mac-system-audio";+import { recordScreenWindowsContent } from "../content/blog-content/windows-11-record-screen-system-audio-no-stereo-mix";++export const INTERACTIVE_BLOG_REGISTRY = {+ [recordScreenMacContent.slug]: recordScreenMacContent,+ [recordScreenWindowsContent.slug]: recordScreenWindowsContent,+} as const;++export type InteractiveBlogSlug = keyof typeof INTERACTIVE_BLOG_REGISTRY;++export function getInteractiveBlogContent(slug: string) {+ const content = INTERACTIVE_BLOG_REGISTRY[slug as InteractiveBlogSlug];+ if (!content) {+ throw new Error(`No interactive blog content found for slug: ${slug}`);+ }+ return content;+}++export function isInteractiveBlogPost(+ slug: string | number,+): slug is InteractiveBlogSlug {+ return typeof slug === "string" && slug in INTERACTIVE_BLOG_REGISTRY;+}++export function getAllInteractiveBlogPosts() {+ return Object.values(INTERACTIVE_BLOG_REGISTRY);+}diff --git a/apps/web/utils/blog.ts b/apps/web/utils/blog.tsindex eee7c9b99..4013aa610 100644--- a/apps/web/utils/blog.ts+++ b/apps/web/utils/blog.ts@@ -1,6 +1,6 @@import fs from "fs";import path from "path";-import { recordScreenMacContent } from "../content/blog-content/record-screen-mac-system-audio";+import { getAllInteractiveBlogPosts } from "./blog-registry";export type PostMetadata = {title: string;@@ -27,32 +27,17 @@ export interface BlogPost {isManual?: boolean;}-interface ManualBlogPost {+interface InteractiveBlogPost {slug: string;- content: {- title: string;- description: string;- publishedAt: string;- author: string;- tags?: string[];- image?: string;- [key: string]: any;- };+ title: string;+ description: string;+ publishedAt: string;+ author: string;+ tags?: string[];+ image?: string;+ [key: string]: any;}-export const manualBlogPosts: ManualBlogPost[] = [- {- slug: recordScreenMacContent.slug,- content: {- title: recordScreenMacContent.title,- description: recordScreenMacContent.description,- publishedAt: recordScreenMacContent.publishedAt,- author: recordScreenMacContent.author,- tags: recordScreenMacContent.tags,- },- },-];-function parseFrontmatter(fileContent: string) {const frontmatterRegex = /---\s*([\s\S]*?)\s*---/;const match = frontmatterRegex.exec(fileContent);@@ -133,35 +118,52 @@ function getMDXData(dir: string): BlogPost[] {});}-export function getManualBlogPosts(): BlogPost[] {+function getInteractiveBlogPosts(): BlogPost[] {try {- return manualBlogPosts.map(({ slug, content }) => {- return {- slug,- metadata: {- title: content.title,- author: content.author,- publishedAt: content.publishedAt,- summary: content.description,- description: content.description,- tags: content.tags?.join(", ") || "",- image: content.image,- },- content: "",- isManual: true,- } as BlogPost;- });+ const interactivePosts = getAllInteractiveBlogPosts();++ return interactivePosts.map((post) => ({+ slug: post.slug,+ metadata: {+ title: post.title,+ author: post.author,+ publishedAt: post.publishedAt,+ summary: post.description,+ description: post.description,+ tags: post.tags?.join(", ") || "",+ },+ content: "",+ isManual: true,+ }));} catch (error) {- console.error("Error getting manual blog posts:", error);+ console.error("Error getting interactive blog posts:", error);return [];}}export function getBlogPosts(): BlogPost[] {const mdxPosts = getMDXData(path.join(process.cwd(), "content/blog"));- const manualPosts = getManualBlogPosts();+ const interactivePosts = getInteractiveBlogPosts();- return [...mdxPosts, ...manualPosts];+ return [...mdxPosts, ...interactivePosts];+}++export async function getInteractiveBlogContent(slug: string) {+ try {+ const contentModule = await import(`../content/blog-content/${slug}`);+ const exportName = Object.keys(contentModule).find(+ (key) => key.endsWith("Content") && contentModule[key]?.slug === slug,+ );++ if (!exportName) {+ throw new Error(`No content export found for slug: ${slug}`);+ }++ return contentModule[exportName];+ } catch (error) {+ console.error(`Error loading interactive blog content for ${slug}:`, error);+ throw error;+ }}export function getDocs() {diff --git a/apps/web/utils/gradients.ts b/apps/web/utils/gradients.tsnew file mode 100644index 000000000..2e897bc02--- /dev/null+++ b/apps/web/utils/gradients.ts@@ -0,0 +1,41 @@+export const generateGradientFromColors = (+ colors: string[],+ angle?: number,+): string => {+ const gradientAngle = angle ?? 135;+ return `linear-gradient(${gradientAngle}deg, ${colors.join(", ")})`;+};++export const generateGradientFromSlug = (+ slug: string,+ customColors?: string[],+): string => {+ if (customColors && customColors.length > 0) {+ return generateGradientFromColors(customColors, 135);+ }++ let hash = 0;+ for (let i = 0; i < slug.length; i++) {+ const char = slug.charCodeAt(i);+ hash = (hash << 5) - hash + char;+ hash = hash & hash;+ }++ const pastelColors = [+ ["#fef3f2", "#fee2d5", "#fed7d7"], // soft reds/pinks+ ["#f0f9ff", "#e0f2fe", "#dbeafe"], // soft blues+ ["#f0fdf4", "#dcfce7", "#d1fae5"], // soft greens+ ["#fffbeb", "#fef3c7", "#fed7aa"], // soft yellows/oranges+ ["#fdf4ff", "#fae8ff", "#f3e8ff"], // soft purples+ ["#f5f5f5", "#e5e7eb", "#d1d5db"], // soft grays+ ["#fff7ed", "#ffedd5", "#fed7aa"], // soft peach+ ["#f0fdfa", "#ccfbf1", "#a7f3d0"], // soft teals+ ];++ const colorIndex = Math.abs(hash) % pastelColors.length;+ const colorSet = pastelColors[colorIndex] ??+ pastelColors[0] ?? ["#f0f9ff", "#e0f2fe", "#dbeafe"];++ const angle = Math.abs(hash) % 360;+ return `linear-gradient(${angle}deg, ${colorSet[0]}, ${colorSet[1]}, ${colorSet[2]})`;+};