diff --git a/apps/docs/app/layout.tsx b/apps/docs/app/layout.tsx index 1c6adc0f..9130aad4 100644 --- a/apps/docs/app/layout.tsx +++ b/apps/docs/app/layout.tsx @@ -1,8 +1,8 @@ import "./global.css"; +import { GoogleAnalytics } from "@next/third-parties/google"; import { RootProvider } from "fumadocs-ui/provider"; import { Inter } from "next/font/google"; import type { ReactNode } from "react"; -import { GoogleAnalytics } from "@next/third-parties/google"; const inter = Inter({ subsets: ["latin"], }); diff --git a/apps/website/app/[locale]/blog/[slug]/page.tsx b/apps/website/app/[locale]/blog/[slug]/page.tsx index 95a95db9..d0271e35 100644 --- a/apps/website/app/[locale]/blog/[slug]/page.tsx +++ b/apps/website/app/[locale]/blog/[slug]/page.tsx @@ -105,25 +105,28 @@ export default async function BlogPostPage({ params }: Props) { const scripts = doc.querySelectorAll( 'script[type="application/ld+json"], script', ); - scripts.forEach((script) => script.remove()); + for (const script of scripts) { + script.remove(); + } // Remover otros elementos no deseados const unwantedElements = doc.querySelectorAll("style, meta, link"); - unwantedElements.forEach((el) => el.remove()); + for (const el of unwantedElements) { + el.remove(); + } return doc.body.innerHTML; - } else { - // Fallback para servidor - usar regex para limpiar - return html - .replace( - /]*type="application\/ld\+json"[^>]*>[\s\S]*?<\/script>/gi, - "", - ) - .replace(/]*>[\s\S]*?<\/script>/gi, "") - .replace(/]*>[\s\S]*?<\/style>/gi, "") - .replace(/]*>/gi, "") - .replace(/]*>/gi, ""); } + // Fallback para servidor - usar regex para limpiar + return html + .replace( + /]*type="application\/ld\+json"[^>]*>[\s\S]*?<\/script>/gi, + "", + ) + .replace(/]*>[\s\S]*?<\/script>/gi, "") + .replace(/]*>[\s\S]*?<\/style>/gi, "") + .replace(/]*>/gi, "") + .replace(/]*>/gi, ""); }; // Convertir HTML a Markdown @@ -214,11 +217,8 @@ export default async function BlogPostPage({ params }: Props) { className="object-cover max-w-lg mx-auto rounded-lg border max-lg:w-64 border-border overflow-hidden" /> ), - code: ({ - className, - children, - inline, - }: { className: string; children: React.ReactNode; inline: boolean }) => { + code: (props: any) => { + const { className, children, inline } = props; console.log(className, children, inline); // Si es código inline (no tiene className con language-*), renderizar como span if (inline || !className || !/language-(\w+)/.test(className)) { diff --git a/apps/website/app/[locale]/blog/tag/[tag]/page.tsx b/apps/website/app/[locale]/blog/tag/[tag]/page.tsx index c8806e5f..e18290ad 100644 --- a/apps/website/app/[locale]/blog/tag/[tag]/page.tsx +++ b/apps/website/app/[locale]/blog/tag/[tag]/page.tsx @@ -23,7 +23,7 @@ export async function generateMetadata({ params }: Props): Promise { export async function generateStaticParams() { const tags = await getTags(); - return tags.map((tag: { slug: string }) => ({ + return (tags as Array<{ slug: string }>).map((tag) => ({ tag: tag.slug, })); } @@ -39,7 +39,8 @@ export default async function TagPage({ params }: Props) { // Get the tag name from the first post const tagName = - posts[0].tags?.find((t: { slug: string }) => t.slug === tag)?.name || tag; + (posts as Post[])[0].tags?.find((t: { slug: string }) => t.slug === tag) + ?.name || tag; return (
@@ -73,8 +74,8 @@ export default async function TagPage({ params }: Props) {
- {posts.map((post: Post) => ( - + {(posts as Post[]).map((post: Post) => ( + ))}
diff --git a/apps/website/app/layout.tsx b/apps/website/app/layout.tsx index b5e571b0..c8cae4b7 100644 --- a/apps/website/app/layout.tsx +++ b/apps/website/app/layout.tsx @@ -1,10 +1,10 @@ +import { GoogleAnalytics } from "@next/third-parties/google"; import clsx from "clsx"; import type { Metadata } from "next"; import { NextIntlClientProvider } from "next-intl"; import { getMessages } from "next-intl/server"; import { Inter, Lexend } from "next/font/google"; import type { ReactNode } from "react"; -import { GoogleAnalytics } from "@next/third-parties/google"; type Props = { children: ReactNode; diff --git a/apps/website/components/Footer.tsx b/apps/website/components/Footer.tsx index dfa8aac7..c28a9041 100644 --- a/apps/website/components/Footer.tsx +++ b/apps/website/components/Footer.tsx @@ -6,7 +6,7 @@ import { SelectItem, SelectTrigger, } from "@/components/ui/select"; -import { Link, useRouter } from "@/i18n/routing"; +import { Link, redirect, useRouter } from "@/i18n/routing"; import { useLocale, useTranslations } from "next-intl"; import type { SVGProps } from "react"; import { Container } from "./Container"; @@ -91,9 +91,10 @@ export function Footer() {