adding the article suggestion at the end of the blog post
Deploy Vercel / deploy-preprod (push) Successful in 1m9s
Deploy Vercel / deploy-production (push) Has been skipped

This commit is contained in:
2026-07-08 09:36:56 +02:00
parent 5f41471108
commit abc3a9095c
6 changed files with 140 additions and 7 deletions
+11 -1
View File
@@ -2,9 +2,10 @@ import React from "react";
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { MDXRemote } from "next-mdx-remote/rsc";
import { getArticleBySlug, getAllArticles, getAlternatesArticle } from "@/lib/blog/get-articles";
import { getArticleBySlug, getAllArticles, getAlternatesArticle, getRandomOtherArticles } from "@/lib/blog/get-articles";
import { ArticleHero } from "@/app/[locale]/blog/[slug]/_components/ArticleHero";
import { ArticleSummary } from "@/app/[locale]/blog/[slug]/_components/ArticleSummary";
import { OtherArticles } from "@/app/[locale]/blog/[slug]/_components/OtherArticles";
import { locales } from "@/middleware";
import Link from "next/link";
import { MermaidDiagram } from "@/components/mdx/MermaidDiagram";
@@ -144,6 +145,13 @@ export default async function ArticlePage({ params }: props) {
const articleUrl = `${siteUrl}/${locale}/blog/${slug}`;
const otherArticles = getRandomOtherArticles(locale, slug, 2).map((item) => ({
slug: item.slug,
title: item.title,
description: item.description,
cover: item.cover,
}));
const imageUrl = article.cover
? article.cover.startsWith("http")
? article.cover
@@ -229,6 +237,8 @@ export default async function ArticlePage({ params }: props) {
components={mdxComponents}
/>
</article>
<OtherArticles locale={locale} articles={otherArticles} />
</div>
</main>
);