This commit is contained in:
Vaica committed 2026-06-22 00:41:05 +08:00
1 parent ed14361e7b
commit d664326648
8 files changed
+39 -14

No files matched your search

+2 -2
View File
@@ -4,7 +4,6 @@ import { useState, useEffect, use } from "react";
import { useRouter } from "next/navigation";
import { ArrowLeft, Eye } from "lucide-react";
import PostEditor from "@/components/PostEditor";
import { HUGO_PREVIEW } from "@/lib/config";
import type { Post } from "@/lib/posts";
export default function EditPostPage({
@@ -74,7 +73,8 @@ export default function EditPostPage({
type="button"
onClick={async () => {
await fetch("/api/hugo");
window.open(`${HUGO_PREVIEW}/${post.frontMatter.slug}.html`, "_blank");
const previewBase = `${location.protocol}//${location.hostname}:1313`;
window.open(`${previewBase}/${post.frontMatter.slug}.html`, "_blank");
}}
className="flex items-center gap-1.5 px-3 py-1.5 text-[12px] rounded-md border border-line text-muted hover:text-accent hover:border-accent/30 transition-colors"
title="预览"