fix(products): add externalUrl support for standalone products and fix footer alignment
- Add externalUrl field to standalone product content type - Filter out externalUrl products from generateStaticParams - Fix email icon vertical alignment in footer
This commit is contained in:
@@ -8,7 +8,10 @@ export const revalidate = 3600;
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const items = await getPublishedItems('standalone-product');
|
||||
return items.map((item) => ({ id: item.slug! }));
|
||||
// 排除有 externalUrl 的产品(它们会跳转到外部域名,无需生成静态页面)
|
||||
return items
|
||||
.filter((item) => !item.data.externalUrl)
|
||||
.map((item) => ({ id: item.slug! }));
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ id: string }> }): Promise<Metadata> {
|
||||
|
||||
Reference in New Issue
Block a user