|
@@ -5,13 +5,22 @@ import Nav from "@/components/Nav";
|
|
|
import Footer from "@/components/Footer";
|
|
|
import styles from "./partner.module.css";
|
|
|
import { fetchConsultants, fetchConsultantDetail } from "@/lib/cms";
|
|
|
+import { getDescLast } from "@/lib/parser";
|
|
|
|
|
|
-export const metadata: Metadata = {
|
|
|
- title: "吕守升-创始人、战略解码专家-助力中国高潜企业加速发展-高潜咨询",
|
|
|
- description:
|
|
|
- "擅长领域:战略管理、组织变革及人力资源管理。著有畅销书《战略解码:跨越战略与执行的鸿沟》,是“战略解码®”方法体系的创始人及商标持有者。",
|
|
|
- keywords: ["吕守升", "Samson Lv", "创始人", "战略解码专家"],
|
|
|
-};
|
|
|
+export async function generateMetadata({ params }) {
|
|
|
+ const partnerId = params.id;
|
|
|
+ const { data: info } = await fetchConsultantDetail(parseInt(partnerId as string));
|
|
|
+ const cnName = info?.cnName;
|
|
|
+ const enName = info?.enName;
|
|
|
+ const title = info?.title;
|
|
|
+ const desc = info?.desc;
|
|
|
+ const description = getDescLast(desc);
|
|
|
+ return {
|
|
|
+ title: `${cnName}-${title}-助力中国高潜企业加速发展-高潜咨询`,
|
|
|
+ description: description,
|
|
|
+ keywords: [cnName, enName, ...title.split(/[\u3001\uFF0C]+/)],
|
|
|
+ };
|
|
|
+}
|
|
|
|
|
|
export default async function Partner({ params }: { params: { id: string } }) {
|
|
|
const partnerId = params.id;
|
|
@@ -47,7 +56,14 @@ export default async function Partner({ params }: { params: { id: string } }) {
|
|
|
<div className={styles.info}>
|
|
|
<div className={styles.left}>
|
|
|
<div className={styles.imgWrapper}>
|
|
|
- <img src={info?.photo} className={styles.partnerPhoto} />
|
|
|
+ <Image
|
|
|
+ alt="photo"
|
|
|
+ width={275}
|
|
|
+ height={350}
|
|
|
+ src={info?.photo}
|
|
|
+ className={styles.partnerPhoto}
|
|
|
+ priority={true}
|
|
|
+ />
|
|
|
<div className={styles.box}></div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -66,7 +82,7 @@ export default async function Partner({ params }: { params: { id: string } }) {
|
|
|
return null;
|
|
|
} else {
|
|
|
return (
|
|
|
- <a href={`/partner/${item.id}`}>
|
|
|
+ <a href={`/partner/${item.id}`} key={index}>
|
|
|
<div className={styles.item}>
|
|
|
<div className={styles.cnName}>{item.cnName}</div>|{" "}
|
|
|
<div className={styles.enName}>{item.enName}</div>
|