Skip to content

Commit e61b016

Browse files
committed
fixed image rendering
1 parent 119381b commit e61b016

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/course/[module]/[lesson]/page.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ import { cn } from "@/lib/utils"
1717
import remarkUnwrapImages from "remark-unwrap-images"
1818

1919
// Helper to make hrefs work with GitHub Pages / subdirectory deployment
20+
const repoName = process.env.NEXT_PUBLIC_REPO_NAME || "VibeCoding_Tutorial";
21+
const basePath = `/${repoName}`;
22+
2023
const processHref = (href?: string) => {
21-
const basePath = "/vibecoding_tutorial"
2224
return href?.startsWith("/") && !href.startsWith(basePath)
2325
? `${basePath}${href}`
2426
: href
@@ -333,13 +335,13 @@ export default async function LessonPage({ params }: LessonPageProps) {
333335
if (!inline && language === "video") {
334336
try {
335337
const content = JSON.parse(contentStr)
338+
const videoSrc = processHref(content.src)
336339
return (
337340
<div className="my-10 not-prose">
338341
<video
339-
src={content.src}
342+
src={videoSrc}
340343
controls={content.controls !== false}
341344
className="w-full rounded-xl shadow-lg border border-border/50 bg-black"
342-
{...content}
343345
/>
344346
{content.caption && (
345347
<p className="text-center text-sm text-muted-foreground mt-3 italic">

app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export default function RootLayout({
3131
>
3232
<ThemeProvider
3333
attribute="class"
34-
defaultTheme="system"
35-
enableSystem
34+
defaultTheme="light"
35+
enableSystem={false}
3636
disableTransitionOnChange
3737
>
3838
{children}

0 commit comments

Comments
 (0)