feat: 可配置站点 URL 风格
- 新增 urlStyle 工具与测试:postPath/userPath/sitePagePath 统一生成链接 - 管理端新增 UrlStylePanel 设置面板,settings 服务与 handler 适配 - 全站路由链接与 JSON-LD/sitemap 切换为统一 URL 生成 - middleware 与相关组件适配
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import PostComposer from "@/components/PostComposer";
|
||||
import { useUrlStyle } from "@/components/SiteBrandProvider";
|
||||
import { postPath } from "@/lib/urlStyle";
|
||||
import type { PostAttachment } from "@/lib/api";
|
||||
|
||||
type Props = {
|
||||
@@ -34,6 +36,7 @@ export default function EditPostClient({
|
||||
boardColorIndex = 0,
|
||||
boardIcon,
|
||||
}: Props) {
|
||||
const urlStyle = useUrlStyle();
|
||||
return (
|
||||
<PostComposer
|
||||
mode="edit"
|
||||
@@ -50,7 +53,7 @@ export default function EditPostClient({
|
||||
boardId={boardId}
|
||||
boardColorIndex={boardColorIndex}
|
||||
boardIcon={boardIcon}
|
||||
cancelHref={`/post/${postId}`}
|
||||
cancelHref={postPath(urlStyle, postId)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user