feat: Refactor generateMetadata function and add support for jsDelivr CDN for images

This commit is contained in:
mauro-balades
2024-08-27 16:52:58 +02:00
parent fc96c2c257
commit 7ca8d4fb7c
2 changed files with 35 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
"use client";
import Image from "next/image";
import { getThemeAuthorLink, getThemeFromId, getThemeMarkdown, ZenTheme } from "@/lib/themes";
import { Button } from "./ui/button";
@@ -19,10 +19,10 @@ export default async function ThemePage({ themeID }: { themeID: string }) {
return (
<div className="mt-24 lg:mt-56 flex-col lg:flex-row flex mx-auto items-start relative">
<div className="flex flex-col relative lg:sticky lg:top-0 w-md h-full p-5 lg:p-0 lg:pr-5 mr-5 w-full md:max-w-sm">
<div className="flex mt-2 mb-9 items-center cursor-pointer opacity-70" onClick={() => window.history.back()}>
<a className="flex mt-2 mb-9 items-center cursor-pointer opacity-70" href="/themes">
<ChevronLeft className="w-4 h-4 mr-1" />
<h3 className="text-md">Go back</h3>
</div>
</a>
<Image src={theme.image} alt={theme.name} width={500} height={500} className="w-full object-cover rounded-lg border-2 shadow" />
<h1 className="text-2xl mt-5 font-bold">{theme.name}</h1>
<p className="text-sm text-muted-foreground mt-2">{theme.description}</p>