feat(admin): 独立后台壳、站点分析与聊天监管,公开站拆出主题切换与访问埋点

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-17 04:00:14 +08:00
parent cda5fad2e5
commit 9a55c2f6f2
41 changed files with 5655 additions and 1810 deletions

View File

@@ -1,6 +1,7 @@
"use client";
import type { AnchorHTMLAttributes } from "react";
import { usePostLinkNewTab } from "@/components/PostLinkProvider";
type MdLinkProps = AnchorHTMLAttributes<HTMLAnchorElement>;
@@ -21,14 +22,15 @@ function isExternalHref(href?: string): boolean {
return /^https?:\/\//i.test(href);
}
/** Markdown 链接:外链新开页 */
/** Markdown 链接:外链是否新开由站点设置 post_link_new_tab 控制 */
export default function MdLink({ href, children, ...rest }: MdLinkProps) {
const openInNewTab = usePostLinkNewTab();
const external = isExternalHref(href);
return (
<a
{...rest}
href={href}
{...(external
{...(external && openInNewTab
? { target: "_blank", rel: "noopener noreferrer" }
: {})}
>