From 46dc97e75caf40f66a1135eeb5474ccc276bd329 Mon Sep 17 00:00:00 2001 From: Maximilian Kaske <56969857+mxkaske@users.noreply.github.com> Date: Thu, 5 Feb 2026 10:06:01 +0100 Subject: [PATCH] fix: mobile friendly content metadata (#1828) --- .../src/app/(landing)/blog/[slug]/page.tsx | 22 +++-------------- .../app/(landing)/changelog/[slug]/page.tsx | 8 +++---- .../src/app/(landing)/content-metadata.tsx | 24 +++++++++++++++++++ .../src/app/(landing)/guides/[slug]/page.tsx | 22 +++-------------- 4 files changed, 33 insertions(+), 43 deletions(-) create mode 100644 apps/web/src/app/(landing)/content-metadata.tsx diff --git a/apps/web/src/app/(landing)/blog/[slug]/page.tsx b/apps/web/src/app/(landing)/blog/[slug]/page.tsx index 21b5363bf..8cf474de0 100644 --- a/apps/web/src/app/(landing)/blog/[slug]/page.tsx +++ b/apps/web/src/app/(landing)/blog/[slug]/page.tsx @@ -1,6 +1,5 @@ import { CustomMDX } from "@/content/mdx"; -import { formatDate, getBlogPosts } from "@/content/utils"; -import { getAuthor } from "@/data/author"; +import { getBlogPosts } from "@/content/utils"; import { BASE_URL, getPageMetadata } from "@/lib/metadata/shared-metadata"; import { createJsonLDGraph, @@ -14,6 +13,7 @@ import { import type { Metadata } from "next"; import Image from "next/image"; import { notFound } from "next/navigation"; +import { ContentMetadata } from "../../content-metadata"; import { ContentPagination } from "../../content-pagination"; export const dynamicParams = false; @@ -85,10 +85,7 @@ export default async function Blog({ }} />

{post.metadata.title}

-

- {formatDate(post.metadata.publishedAt)} | by{" "} - | [{post.metadata.category}] -

+ {post.metadata.image ? (
); } - -function Author({ author }: { author: string }) { - const authorData = getAuthor(author); - if (typeof authorData === "string") { - return author; - } - - return ( - - {authorData.name} - - ); -} diff --git a/apps/web/src/app/(landing)/changelog/[slug]/page.tsx b/apps/web/src/app/(landing)/changelog/[slug]/page.tsx index 01b27925a..dba250a7e 100644 --- a/apps/web/src/app/(landing)/changelog/[slug]/page.tsx +++ b/apps/web/src/app/(landing)/changelog/[slug]/page.tsx @@ -1,5 +1,5 @@ import { CustomMDX } from "@/content/mdx"; -import { formatDate, getChangelogPosts } from "@/content/utils"; +import { getChangelogPosts } from "@/content/utils"; import { BASE_URL, getPageMetadata } from "@/lib/metadata/shared-metadata"; import { createJsonLDGraph, @@ -13,6 +13,7 @@ import { import type { Metadata } from "next"; import Image from "next/image"; import { notFound } from "next/navigation"; +import { ContentMetadata } from "../../content-metadata"; import { ContentPagination } from "../../content-pagination"; export const dynamicParams = false; @@ -84,10 +85,7 @@ export default async function Changelog({ }} />

{post.metadata.title}

-

- {formatDate(post.metadata.publishedAt)} | by {post.metadata.author} | [ - {post.metadata.category}] -

+ {post.metadata.image ? (
+ {formatDate(data.metadata.publishedAt)} | by{" "} + | [{data.metadata.category}] +

+ ); +} + +function Author({ author }: { author: string }) { + const authorData = getAuthor(author); + if (typeof authorData === "string") { + return author; + } + + return ( + + {authorData.name} + + ); +} diff --git a/apps/web/src/app/(landing)/guides/[slug]/page.tsx b/apps/web/src/app/(landing)/guides/[slug]/page.tsx index 25966dade..2d6f0f3e6 100644 --- a/apps/web/src/app/(landing)/guides/[slug]/page.tsx +++ b/apps/web/src/app/(landing)/guides/[slug]/page.tsx @@ -1,6 +1,5 @@ import { CustomMDX } from "@/content/mdx"; -import { formatDate, getGuides } from "@/content/utils"; -import { getAuthor } from "@/data/author"; +import { getGuides } from "@/content/utils"; import { BASE_URL, getPageMetadata } from "@/lib/metadata/shared-metadata"; import { createJsonLDGraph, @@ -14,6 +13,7 @@ import { import type { Metadata } from "next"; import Image from "next/image"; import { notFound } from "next/navigation"; +import { ContentMetadata } from "../../content-metadata"; import { ContentPagination } from "../../content-pagination"; export const dynamicParams = false; @@ -85,10 +85,7 @@ export default async function Guide({ }} />

{post.metadata.title}

-

- {formatDate(post.metadata.publishedAt)} | by{" "} - | [{post.metadata.category}] -

+ {post.metadata.image ? (
); } - -function Author({ author }: { author: string }) { - const authorData = getAuthor(author); - if (typeof authorData === "string") { - return author; - } - - return ( - - {authorData.name} - - ); -} -- 2.54.0