0041
This commit is contained in:
1 parent
ed14361e7b
commit
d664326648
8 files changed
+39
-14
No files matched your search
@@ -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="预览"
|
||||
|
||||
Reference in new issue
Block a user