fix: page and OpenGraph titles
This commit is contained in:
parent
2f66a1dc88
commit
d422953ad7
3 changed files with 9 additions and 4 deletions
|
@ -4,6 +4,7 @@ import contentMap from "@developomp-site/content/exports/contentMap"
|
||||||
import { type Metadata } from "next"
|
import { type Metadata } from "next"
|
||||||
import { type ParsedUrlQuery } from "querystring"
|
import { type ParsedUrlQuery } from "querystring"
|
||||||
|
|
||||||
|
import { titlePrefix } from "@/app/layout"
|
||||||
import { metadata as notFoundMetadata } from "@/app/not-found"
|
import { metadata as notFoundMetadata } from "@/app/not-found"
|
||||||
import Card from "@/components/Card"
|
import Card from "@/components/Card"
|
||||||
import PostCard from "@/components/PostCard"
|
import PostCard from "@/components/PostCard"
|
||||||
|
@ -59,7 +60,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||||
metadataBase: new URL("https://blog.developomp.com"),
|
metadataBase: new URL("https://blog.developomp.com"),
|
||||||
title: pageData.title,
|
title: pageData.title,
|
||||||
openGraph: {
|
openGraph: {
|
||||||
title: pageData.title,
|
title: titlePrefix + pageData.title,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,12 @@ import Image from "next/image"
|
||||||
import Footer from "@/components/Footer"
|
import Footer from "@/components/Footer"
|
||||||
import Header from "@/components/Header"
|
import Header from "@/components/Header"
|
||||||
|
|
||||||
|
export const titlePrefix = "pomp's blog | "
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
metadataBase: new URL("https://blog.developomp.com"),
|
metadataBase: new URL("https://blog.developomp.com"),
|
||||||
title: {
|
title: {
|
||||||
template: "pomp's blog | %s",
|
template: `${titlePrefix}%s`,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
description: "developomp's Blog",
|
description: "developomp's Blog",
|
||||||
|
|
|
@ -2,11 +2,13 @@ import { type Metadata } from "next"
|
||||||
|
|
||||||
import Card from "@/components/Card"
|
import Card from "@/components/Card"
|
||||||
|
|
||||||
|
import { titlePrefix } from "./layout"
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
metadataBase: new URL("https://blog.developomp.com"),
|
metadataBase: new URL("https://blog.developomp.com"),
|
||||||
title: "pomp's blog | Page Not Found",
|
title: "Page Not Found",
|
||||||
openGraph: {
|
openGraph: {
|
||||||
title: "pomp's blog | Page Not Found",
|
title: titlePrefix + "Page Not Found",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue