create-freeholder 0.2.0-beta.4 → 0.2.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/template/.changeset/blog-playground-content.md +4 -0
- package/dist/template/.changeset/blog-wordpress-structure.md +6 -0
- package/dist/template/.changeset/managed-preview-assistant.md +4 -0
- package/dist/template/.changeset/native-linux-install.md +6 -0
- package/dist/template/.changeset/public-beta-5.md +4 -0
- package/dist/template/.changeset/public-beta-6.md +4 -0
- package/dist/template/.github/ISSUE_TEMPLATE/bug_report.yml +1 -1
- package/dist/template/.github/workflows/release-tarballs.yml +117 -0
- package/dist/template/AGENTS.md +15 -2
- package/dist/template/Dockerfile +3 -0
- package/dist/template/MASTER.md +114 -11
- package/dist/template/README.md +1 -1
- package/dist/template/app/(admin)/admin/assistant/page.tsx +9 -1
- package/dist/template/app/(admin)/admin/blog/PostSettings.tsx +26 -0
- package/dist/template/app/(admin)/admin/blog/[kind]/page.tsx +53 -0
- package/dist/template/app/(admin)/admin/blog/actions.ts +186 -6
- package/dist/template/app/(admin)/admin/blog/comments/page.tsx +25 -0
- package/dist/template/app/(admin)/admin/blog/page.tsx +21 -5
- package/dist/template/app/(admin)/admin/imports/[id]/page.tsx +2 -0
- package/dist/template/app/(admin)/admin/pages/[id]/page.tsx +3 -0
- package/dist/template/app/(admin)/assistant-actions.ts +13 -6
- package/dist/template/app/(public)/[[...slug]]/ReaderComments.tsx +25 -0
- package/dist/template/app/(public)/[[...slug]]/blog-parts.tsx +153 -0
- package/dist/template/app/(public)/[[...slug]]/comment-actions.ts +16 -0
- package/dist/template/app/(public)/[[...slug]]/page.tsx +182 -18
- package/dist/template/app/api/chat/assistant/call/route.ts +35 -0
- package/dist/template/db/migrations/0061_blog_structure.sql +89 -0
- package/dist/template/db/migrations/0062_blog_reader_comments.sql +24 -0
- package/dist/template/db/migrations/meta/_journal.json +14 -0
- package/dist/template/deploy/README.md +26 -9
- package/dist/template/deploy/blog-wordpress-2026-11-07.md +146 -0
- package/dist/template/deploy/docker-selfhost/.env.example +11 -1
- package/dist/template/deploy/docker-selfhost/README.md +79 -50
- package/dist/template/deploy/docker-selfhost/infra/backup.sh +81 -0
- package/dist/template/deploy/docker-selfhost/infra/compose.https.yml +37 -1
- package/dist/template/deploy/docker-selfhost/infra/compose.yml +37 -1
- package/dist/template/deploy/docker-selfhost/migrate.md +8 -5
- package/dist/template/deploy/docker-selfhost/recipe.yaml +9 -10
- package/dist/template/deploy/docker-selfhost/selfhost.sh +206 -0
- package/dist/template/deploy/docker-selfhost/verify.md +11 -4
- package/dist/template/deploy/f-criteria-matrix.md +89 -0
- package/dist/template/deploy/linux/.env.example +28 -0
- package/dist/template/deploy/linux/README.md +181 -0
- package/dist/template/deploy/linux/freeholder +655 -0
- package/dist/template/deploy/linux/install.sh +173 -0
- package/dist/template/deploy/linux/migrate.md +17 -0
- package/dist/template/deploy/linux/recipe.yaml +50 -0
- package/dist/template/deploy/linux/share/Caddyfile.template +19 -0
- package/dist/template/deploy/linux/share/systemd/freeholder-backup.service +13 -0
- package/dist/template/deploy/linux/share/systemd/freeholder-backup.timer +12 -0
- package/dist/template/deploy/linux/share/systemd/freeholder.service +41 -0
- package/dist/template/deploy/linux/verify.md +22 -0
- package/dist/template/deploy/managed-preview-assistant.md +99 -0
- package/dist/template/eslint.config.mjs +3 -1
- package/dist/template/gitignore.template +1 -0
- package/dist/template/locales/ar.json +85 -6
- package/dist/template/locales/en.json +83 -4
- package/dist/template/locales/es.json +83 -4
- package/dist/template/locales/fr.json +85 -6
- package/dist/template/next.config.ts +2 -0
- package/dist/template/package.json +3 -2
- package/dist/template/packages/cli/package.json +1 -1
- package/dist/template/packages/create-freeholder/package.json +1 -1
- package/dist/template/packages/freeholder-app/package.json +1 -1
- package/dist/template/packages/mobile-app/package.json +1 -1
- package/dist/template/packages/plugin-kit/package.json +1 -1
- package/dist/template/packages/sdk/package.json +1 -1
- package/dist/template/packages/sdk/src/generated.ts +177 -9
- package/dist/template/packages/sdk/src/version.ts +1 -1
- package/dist/template/packages/templates/package.json +1 -1
- package/dist/template/proxy.ts +18 -1
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/NOTICE.txt +117 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/audio-output-processor.js +267 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/decoderWorker.min.js +847 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/decoderWorker.min.wasm +0 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/encoderWorker.min.js +1 -0
- package/dist/template/public/managed-assistant/0.1.10/manifest.json +12 -0
- package/dist/template/public/managed-assistant/0.1.10/pm-ai-duplex-client.js +1376 -0
- package/dist/template/scripts/build-release.d.mts +4 -0
- package/dist/template/scripts/build-release.mjs +171 -0
- package/dist/template/scripts/launch-prepare.mjs +6 -3
- package/dist/template/scripts/license-headers.mjs +3 -0
- package/dist/template/scripts/recipe-matrix.sh +22 -7
- package/dist/template/scripts/verify-wordpress-migration.d.mts +8 -0
- package/dist/template/scripts/verify-wordpress-migration.mjs +105 -0
- package/dist/template/security/adversarial-audit-2026-10-08.md +1 -1
- package/dist/template/src/adapters/ai/types.ts +5 -0
- package/dist/template/src/adapters/paradise/assistant.ts +37 -0
- package/dist/template/src/adapters/paradise/http.ts +4 -3
- package/dist/template/src/adapters/storage/local-mode.ts +54 -0
- package/dist/template/src/adapters/storage/local.ts +53 -26
- package/dist/template/src/core/contract/json-schema.ts +8 -0
- package/dist/template/src/core/demo/playground-inserts.ts +29 -0
- package/dist/template/src/core/demo/playground-policy.ts +9 -0
- package/dist/template/src/core/doctor/index.ts +19 -10
- package/dist/template/src/core/env.ts +8 -1
- package/dist/template/src/core/http/csp.ts +10 -2
- package/dist/template/src/core/http/csrf-client.ts +10 -0
- package/dist/template/src/core/import/service.ts +217 -12
- package/dist/template/src/core/import/wordpress.ts +80 -15
- package/dist/template/src/core/notifications/service.ts +1 -0
- package/dist/template/src/core/retention/registry.ts +2 -0
- package/dist/template/src/core/search/registry.ts +2 -0
- package/dist/template/src/core/seo/feeds.ts +2 -0
- package/dist/template/src/core/seo/jsonld.ts +46 -2
- package/dist/template/src/core/seo/legacy-proxy.ts +53 -0
- package/dist/template/src/core/seo/meta.ts +10 -7
- package/dist/template/src/core/seo/service.ts +14 -1
- package/dist/template/src/core/update/preflight.ts +3 -2
- package/dist/template/src/core/update/release-declaration.json +1 -1
- package/dist/template/src/core/update/service.ts +7 -17
- package/dist/template/src/modules/assistant/contract.ts +1 -1
- package/dist/template/src/modules/assistant/limits.ts +3 -0
- package/dist/template/src/modules/assistant/preview.ts +124 -0
- package/dist/template/src/modules/assistant/provider.ts +7 -0
- package/dist/template/src/modules/assistant/service.ts +21 -5
- package/dist/template/src/modules/cms/blocks/PreviewAssistantCall.tsx +176 -0
- package/dist/template/src/modules/cms/blocks/SiteChatClient.tsx +10 -4
- package/dist/template/src/modules/cms/blocks/surfaces.tsx +10 -0
- package/dist/template/src/modules/cms/blog-comments-schema.ts +27 -0
- package/dist/template/src/modules/cms/blog-comments.ts +111 -0
- package/dist/template/src/modules/cms/blog-schema.ts +146 -0
- package/dist/template/src/modules/cms/blog-service.ts +999 -0
- package/dist/template/src/modules/cms/blog.tsx +245 -25
- package/dist/template/src/modules/cms/manifest.ts +7 -1
- package/dist/template/src/modules/cms/read.ts +18 -0
- package/dist/template/src/modules/cms/service.ts +22 -4
- package/dist/template/src/modules/cms/tables.ts +2 -0
- package/dist/template/src/modules/seed/launch.ts +31 -3
- package/dist/template/tests/browser/blog-structure.spec.ts +69 -0
- package/dist/template/tests/core/agent-launch.test.ts +7 -2
- package/dist/template/tests/core/analytics-consent.test.ts +1 -1
- package/dist/template/tests/core/blog-playground.test.ts +106 -0
- package/dist/template/tests/core/blog-structure-comments.test.ts +166 -0
- package/dist/template/tests/core/client-readiness-security.test.ts +3 -1
- package/dist/template/tests/core/csp.test.ts +1 -1
- package/dist/template/tests/core/deploy-recipe.test.ts +54 -4
- package/dist/template/tests/core/internal-services.test.ts +4 -0
- package/dist/template/tests/core/legacy-redirect-proxy.test.ts +59 -0
- package/dist/template/tests/core/linux-install.test.ts +169 -0
- package/dist/template/tests/core/local-storage-mode.test.ts +29 -0
- package/dist/template/tests/core/locale-routing.test.ts +1 -1
- package/dist/template/tests/core/playground-cache.test.ts +1 -1
- package/dist/template/tests/core/playground.test.ts +3 -3
- package/dist/template/tests/core/preview-assistant-call.test.ts +88 -0
- package/dist/template/tests/core/private-preview-webhooks.test.ts +1 -1
- package/dist/template/tests/core/private-preview.test.ts +1 -1
- package/dist/template/tests/core/proxy-locale.test.ts +1 -1
- package/dist/template/tests/core/sdk-schema.test.ts +20 -0
- package/dist/template/tests/core/seo.test.ts +1 -1
- package/dist/template/tests/core/site-chat-client.test.ts +50 -0
- package/dist/template/tests/core/storage.test.ts +38 -2
- package/dist/template/tests/core/wordpress-import-flow.test.ts +81 -18
- package/dist/template/tests/core/wordpress-import.test.ts +25 -12
- package/dist/template/tests/core/wordpress-migration-verification.test.ts +37 -0
- package/dist/template/tests/modules/preview-assistant.test.ts +164 -0
- package/dist/template-manifest.json +490 -175
- package/package.json +1 -1
|
@@ -1,21 +1,201 @@
|
|
|
1
1
|
// Copyright (C) 2026 Tony Aly
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
"use server";
|
|
4
|
+
// Thin callers for the blog screens (C2.26–C2.28). Every rule lives in the
|
|
5
|
+
// cms services, so the admin, the HTTP API and MCP do the same thing.
|
|
4
6
|
import { redirect } from "next/navigation";
|
|
5
|
-
import {
|
|
7
|
+
import { revalidatePath } from "next/cache";
|
|
8
|
+
import { ensureDefaults } from "@/modules/cms/service";
|
|
9
|
+
import {
|
|
10
|
+
deleteAuthor,
|
|
11
|
+
createPost,
|
|
12
|
+
deleteTerm,
|
|
13
|
+
saveAuthor,
|
|
14
|
+
saveTerm,
|
|
15
|
+
setPostMeta,
|
|
16
|
+
updateBlogSettings,
|
|
17
|
+
} from "@/modules/cms/blog-service";
|
|
18
|
+
import { ServiceError } from "@/core/service";
|
|
19
|
+
import { env } from "@/core/env";
|
|
6
20
|
import { requireStaffActor } from "../guard";
|
|
7
21
|
import { currentBusiness } from "@/core/settings/read";
|
|
22
|
+
import { ownerFacing } from "../../action-helpers";
|
|
23
|
+
import { moderateReaderComment } from "@/modules/cms/blog-comments";
|
|
24
|
+
|
|
25
|
+
function text(form: FormData, key: string): string {
|
|
26
|
+
const value = form.get(key);
|
|
27
|
+
return typeof value === "string" ? value.trim() : "";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function optional(form: FormData, key: string): string | undefined {
|
|
31
|
+
return text(form, key) || undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function refused(error: unknown, back: string): never {
|
|
35
|
+
if (error instanceof Error && error.message === "NEXT_REDIRECT") throw error;
|
|
36
|
+
if (error instanceof Error && "digest" in error) throw error;
|
|
37
|
+
const message = error instanceof ServiceError ? ownerFacing(error.message) : "";
|
|
38
|
+
redirect(`${back}${back.includes("?") ? "&" : "?"}error=${encodeURIComponent(message || "1")}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
8
41
|
export async function createBlogPostAction(form: FormData) {
|
|
9
42
|
const actor = await requireStaffActor("cms", "manage");
|
|
10
43
|
const locale = (await currentBusiness())?.defaultLocale ?? "en";
|
|
11
|
-
const title = (
|
|
12
|
-
const slug = (
|
|
44
|
+
const title = text(form, "title");
|
|
45
|
+
const slug = text(form, "slug").toLowerCase();
|
|
13
46
|
if (!title || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug)) redirect("/admin/blog?error=1");
|
|
14
47
|
let id: string;
|
|
15
48
|
try {
|
|
16
|
-
|
|
17
|
-
|
|
49
|
+
// Playground startup already seeds chrome; visitors cannot run bootstrap.
|
|
50
|
+
if (env().FREEHOLDER_PLAYGROUND !== "1") await ensureDefaults.call({ locale }, actor);
|
|
51
|
+
const page = await createPost.call(
|
|
52
|
+
{
|
|
53
|
+
title,
|
|
54
|
+
slug,
|
|
55
|
+
locale,
|
|
56
|
+
},
|
|
57
|
+
actor,
|
|
58
|
+
);
|
|
18
59
|
id = page.id;
|
|
19
|
-
} catch
|
|
60
|
+
} catch (error) {
|
|
61
|
+
refused(error, "/admin/blog");
|
|
62
|
+
}
|
|
20
63
|
redirect(`/admin/pages/${id}`);
|
|
21
64
|
}
|
|
65
|
+
|
|
66
|
+
export async function saveBlogSettingsAction(form: FormData) {
|
|
67
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
68
|
+
try {
|
|
69
|
+
await updateBlogSettings.call(
|
|
70
|
+
{
|
|
71
|
+
categoryBase: optional(form, "categoryBase"),
|
|
72
|
+
tagBase: optional(form, "tagBase"),
|
|
73
|
+
authorBase: optional(form, "authorBase"),
|
|
74
|
+
postsPerPage: Number(text(form, "postsPerPage")) || undefined,
|
|
75
|
+
commentsEnabled: form.get("commentsEnabled") === "on",
|
|
76
|
+
},
|
|
77
|
+
actor,
|
|
78
|
+
);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
refused(error, "/admin/blog");
|
|
81
|
+
}
|
|
82
|
+
revalidatePath("/admin/blog");
|
|
83
|
+
redirect("/admin/blog?saved=1");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export async function moderateReaderCommentAction(form: FormData) {
|
|
87
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
88
|
+
const status = text(form, "status");
|
|
89
|
+
if (!["pending", "approved", "spam", "trash"].includes(status)) redirect("/admin/blog/comments?error=1");
|
|
90
|
+
try {
|
|
91
|
+
await moderateReaderComment.call({ id: text(form, "id"), status: status as "pending" | "approved" | "spam" | "trash" }, actor);
|
|
92
|
+
} catch (error) { refused(error, "/admin/blog/comments"); }
|
|
93
|
+
revalidatePath("/", "layout");
|
|
94
|
+
redirect("/admin/blog/comments?saved=1");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export async function saveTermAction(form: FormData) {
|
|
98
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
99
|
+
const taxonomy = text(form, "taxonomy") === "tag" ? "tag" : "category";
|
|
100
|
+
const back = taxonomy === "tag" ? "/admin/blog/tags" : "/admin/blog/categories";
|
|
101
|
+
try {
|
|
102
|
+
await saveTerm.call(
|
|
103
|
+
{
|
|
104
|
+
id: optional(form, "id"),
|
|
105
|
+
taxonomy,
|
|
106
|
+
name: text(form, "name"),
|
|
107
|
+
slug: optional(form, "slug"),
|
|
108
|
+
description: text(form, "description") || null,
|
|
109
|
+
...(taxonomy === "category" ? { parentId: text(form, "parentId") || null } : {}),
|
|
110
|
+
seo: {
|
|
111
|
+
title: optional(form, "seoTitle"),
|
|
112
|
+
description: optional(form, "seoDescription"),
|
|
113
|
+
noindex: form.get("noindex") === "on",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
actor,
|
|
117
|
+
);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
refused(error, back);
|
|
120
|
+
}
|
|
121
|
+
revalidatePath(back);
|
|
122
|
+
redirect(`${back}?saved=1`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export async function deleteTermAction(form: FormData) {
|
|
126
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
127
|
+
const back = text(form, "taxonomy") === "tag" ? "/admin/blog/tags" : "/admin/blog/categories";
|
|
128
|
+
try {
|
|
129
|
+
await deleteTerm.call({ id: text(form, "id") }, actor);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
refused(error, back);
|
|
132
|
+
}
|
|
133
|
+
revalidatePath(back);
|
|
134
|
+
redirect(back);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export async function saveAuthorAction(form: FormData) {
|
|
138
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
139
|
+
try {
|
|
140
|
+
await saveAuthor.call(
|
|
141
|
+
{
|
|
142
|
+
id: optional(form, "id"),
|
|
143
|
+
name: text(form, "name"),
|
|
144
|
+
slug: optional(form, "slug"),
|
|
145
|
+
bio: text(form, "bio") || null,
|
|
146
|
+
email: text(form, "email") || null,
|
|
147
|
+
userId: text(form, "userId") || null,
|
|
148
|
+
seo: {
|
|
149
|
+
title: optional(form, "seoTitle"),
|
|
150
|
+
description: optional(form, "seoDescription"),
|
|
151
|
+
noindex: form.get("noindex") === "on",
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
actor,
|
|
155
|
+
);
|
|
156
|
+
} catch (error) {
|
|
157
|
+
refused(error, "/admin/blog/authors");
|
|
158
|
+
}
|
|
159
|
+
revalidatePath("/admin/blog/authors");
|
|
160
|
+
redirect("/admin/blog/authors?saved=1");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export async function deleteAuthorAction(form: FormData) {
|
|
164
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
165
|
+
try {
|
|
166
|
+
await deleteAuthor.call({ id: text(form, "id") }, actor);
|
|
167
|
+
} catch (error) {
|
|
168
|
+
refused(error, "/admin/blog/authors");
|
|
169
|
+
}
|
|
170
|
+
revalidatePath("/admin/blog/authors");
|
|
171
|
+
redirect("/admin/blog/authors");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export async function savePostSettingsAction(form: FormData) {
|
|
175
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
176
|
+
const pageId = text(form, "pageId");
|
|
177
|
+
const back = `/admin/pages/${pageId}`;
|
|
178
|
+
try {
|
|
179
|
+
const isPost = form.get("isPost") === "on";
|
|
180
|
+
await setPostMeta.call(
|
|
181
|
+
isPost
|
|
182
|
+
? {
|
|
183
|
+
pageId,
|
|
184
|
+
isPost,
|
|
185
|
+
authorId: text(form, "authorId") || null,
|
|
186
|
+
categoryIds: form.getAll("categoryIds").filter((value): value is string => typeof value === "string" && value !== ""),
|
|
187
|
+
tagNames: text(form, "tags")
|
|
188
|
+
.split(",")
|
|
189
|
+
.map((tag) => tag.trim())
|
|
190
|
+
.filter(Boolean),
|
|
191
|
+
...(form.has("commentsSetting") ? { commentsEnabled: form.get("commentsEnabled") === "on" } : {}),
|
|
192
|
+
}
|
|
193
|
+
: { pageId, isPost: false },
|
|
194
|
+
actor,
|
|
195
|
+
);
|
|
196
|
+
} catch (error) {
|
|
197
|
+
refused(error, back);
|
|
198
|
+
}
|
|
199
|
+
revalidatePath(back);
|
|
200
|
+
redirect(`${back}?saved=post`);
|
|
201
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright (C) 2026 Tony Aly
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { listReaderCommentsForOwner } from "@/modules/cms/blog-comments";
|
|
4
|
+
import { Button, Select } from "@/ui/primitives";
|
|
5
|
+
import { getT } from "../../../../i18n";
|
|
6
|
+
import { requireStaffActor } from "../../guard";
|
|
7
|
+
import { moderateReaderCommentAction } from "../actions";
|
|
8
|
+
export const dynamic = "force-dynamic";
|
|
9
|
+
const states = ["pending", "approved", "spam", "trash"] as const;
|
|
10
|
+
export default async function CommentQueue({ searchParams }: { searchParams: Promise<{ status?: string; error?: string; saved?: string; page?: string }> }) {
|
|
11
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
12
|
+
const query = await searchParams;
|
|
13
|
+
const status = states.find(value => value === query.status);
|
|
14
|
+
const page = Math.max(1, Math.min(10000, Math.floor(Number(query.page)) || 1));
|
|
15
|
+
const pageHref = (number: number) => `/admin/blog/comments?page=${number}${status ? `&status=${status}` : ""}`;
|
|
16
|
+
const [t, comments] = await Promise.all([getT(), listReaderCommentsForOwner.call({ status, page }, actor)]);
|
|
17
|
+
return <div className="grid max-w-3xl gap-6"><h1 className="text-2xl font-semibold">{t("blog.comments")}</h1>
|
|
18
|
+
<a className="underline" href="/admin/blog">{t("blog.title")}</a>
|
|
19
|
+
<nav className="flex flex-wrap gap-4" aria-label={t("blog.commentStatus")}><a className="underline" href="/admin/blog/comments">{t("blog.commentAll")}</a>{states.map(value => <a key={value} className="underline" href={`/admin/blog/comments?status=${value}`}>{t(`blog.commentState.${value}`)}</a>)}</nav>
|
|
20
|
+
{query.error ? <p role="alert">{t("common.somethingWentWrong")}</p> : null}{query.saved ? <p role="status">{t("blog.saved")}</p> : null}
|
|
21
|
+
{!comments.length ? <p>{t("blog.commentEmpty")}</p> : null}
|
|
22
|
+
<ul className="grid list-none gap-5 p-0">{comments.map(comment => <li key={comment.id} className="grid gap-3 rounded-lg border border-rule bg-surface p-5"><div className="flex flex-wrap justify-between gap-3"><strong>{comment.authorName}</strong><time dateTime={comment.createdAt.toISOString()}>{comment.createdAt.toLocaleString()}</time></div><p className="whitespace-pre-wrap break-words">{comment.body}</p><a className="underline" href={`/admin/pages/${comment.pageId}`}>{t("blog.commentPost")}</a><form action={moderateReaderCommentAction} className="flex flex-wrap gap-3"><input type="hidden" name="id" value={comment.id} /><Select name="status" defaultValue={comment.status} aria-label={t("blog.commentStatus")}>{states.map(value => <option key={value} value={value}>{t(`blog.commentState.${value}`)}</option>)}</Select><Button type="submit">{t("blog.save")}</Button></form></li>)}</ul>
|
|
23
|
+
{page > 1 || comments.length === 100 ? <nav className="flex justify-between gap-4" aria-label={t("blog.comments")}>{page > 1 ? <a className="underline" href={pageHref(page - 1)}>{t("blog.previous")}</a> : <span />}{comments.length === 100 && page < 10000 ? <a className="underline" href={pageHref(page + 1)}>{t("blog.next")}</a> : null}</nav> : null}
|
|
24
|
+
</div>;
|
|
25
|
+
}
|
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
// Copyright (C) 2026 Tony Aly
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
3
|
+
import { getBlogSettings, listPostPages } from "@/modules/cms/blog-service";
|
|
4
4
|
import { Button, Field, Input } from "@/ui/primitives";
|
|
5
5
|
import { getT } from "../../../i18n";
|
|
6
6
|
import { requireStaffActor } from "../guard";
|
|
7
|
-
import { createBlogPostAction } from "./actions";
|
|
7
|
+
import { createBlogPostAction, saveBlogSettingsAction } from "./actions";
|
|
8
8
|
export const dynamic = "force-dynamic";
|
|
9
|
-
export default async function BlogAdmin({ searchParams }: { searchParams: Promise<{ error?: string }> }) {
|
|
9
|
+
export default async function BlogAdmin({ searchParams }: { searchParams: Promise<{ error?: string; saved?: string }> }) {
|
|
10
10
|
const actor = await requireStaffActor("cms", "manage");
|
|
11
|
-
const [t, rows, query] = await Promise.all([getT(),
|
|
12
|
-
return <div className="grid max-w-3xl gap-6"
|
|
11
|
+
const [t, rows, settings, query] = await Promise.all([getT(), listPostPages.call({}, actor), getBlogSettings.call({}, actor), searchParams]);
|
|
12
|
+
return <div className="grid max-w-3xl gap-6">
|
|
13
|
+
<h1 className="text-2xl font-semibold">{t("blog.title")}</h1><p>{t("blog.adminIntro")}</p>
|
|
14
|
+
<nav className="flex flex-wrap gap-4" aria-label={t("blog.title")}><a className="underline" href="/blog">{t("blog.view")}</a>{["categories", "tags", "authors", "comments"].map(kind => <a key={kind} className="underline" href={`/admin/blog/${kind}`}>{t(`blog.${kind}`)}</a>)}</nav>
|
|
15
|
+
{query.error ? <p role="alert">{t("common.somethingWentWrong")}</p> : null}
|
|
16
|
+
{query.saved ? <p role="status">{t("blog.saved")}</p> : null}
|
|
17
|
+
<form action={createBlogPostAction} className="grid gap-4 rounded-lg border border-rule bg-surface p-6">
|
|
18
|
+
<Field label={t("cms.field.pageTitle")} htmlFor="title"><Input id="title" name="title" required maxLength={200} /></Field>
|
|
19
|
+
<Field label={t("cms.field.slug")} htmlFor="slug" hint={t("blog.slugHint")}><Input id="slug" name="slug" required pattern="[a-z0-9]+(-[a-z0-9]+)*" maxLength={160} /></Field>
|
|
20
|
+
<Button type="submit">{t("blog.create")}</Button>
|
|
21
|
+
</form>
|
|
22
|
+
<ul className="grid list-none gap-3 p-0">{rows.map(p => <li key={p.id} className="flex justify-between gap-4 border-b border-rule pb-3"><a className="underline" href={`/admin/pages/${p.id}`}>{p.title}</a><span>{t(`cms.status.${p.status}`)}</span></li>)}</ul>
|
|
23
|
+
<section><h2 className="text-lg font-semibold">{t("blog.settings")}</h2><form action={saveBlogSettingsAction} className="mt-4 grid gap-4">
|
|
24
|
+
{(["categoryBase", "tagBase", "authorBase"] as const).map(key => <Field key={key} label={t(`blog.${key}`)} htmlFor={key}><Input id={key} name={key} defaultValue={settings[key]} required /></Field>)}
|
|
25
|
+
<Field label={t("blog.postsPerPage")} htmlFor="postsPerPage"><Input id="postsPerPage" name="postsPerPage" type="number" min={1} max={50} defaultValue={settings.postsPerPage} required /></Field>
|
|
26
|
+
<label className="flex gap-2"><input type="checkbox" name="commentsEnabled" defaultChecked={settings.commentsEnabled} />{t("blog.commentsEnabled")}</label><Button type="submit">{t("blog.save")}</Button>
|
|
27
|
+
</form></section>
|
|
28
|
+
</div>;
|
|
13
29
|
}
|
|
@@ -33,6 +33,8 @@ export default async function ImportRunPage({
|
|
|
33
33
|
["categories", t("imports.count.categories")],
|
|
34
34
|
["tags", t("imports.count.tags")],
|
|
35
35
|
["authors", t("imports.count.authors")],
|
|
36
|
+
["commentsImported", t("imports.count.commentsImported")],
|
|
37
|
+
["commentsStaged", t("imports.count.commentsStaged")],
|
|
36
38
|
["commentsSkipped", t("imports.count.commentsSkipped")],
|
|
37
39
|
["skippedPages", t("imports.count.skippedPages")],
|
|
38
40
|
];
|
|
@@ -41,6 +41,7 @@ import { PagePresence } from "./PagePresence";
|
|
|
41
41
|
import { PageComments } from "./PageComments";
|
|
42
42
|
import { currentBusiness } from "@/core/settings/read";
|
|
43
43
|
import { detachLayoutAction, fileHelpArticleAction, rejoinLayoutAction } from "../../../cms-actions";
|
|
44
|
+
import { BlogPostSettings } from "../../blog/PostSettings";
|
|
44
45
|
|
|
45
46
|
export const dynamic = "force-dynamic";
|
|
46
47
|
|
|
@@ -155,6 +156,8 @@ export default async function EditPagePage({
|
|
|
155
156
|
</div>
|
|
156
157
|
</div>
|
|
157
158
|
|
|
159
|
+
<BlogPostSettings pageId={page.id} actor={actor} />
|
|
160
|
+
|
|
158
161
|
<PageEditor
|
|
159
162
|
id={page.id}
|
|
160
163
|
initialVersion={page.version}
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
saveKnowledge,
|
|
21
21
|
setScope,
|
|
22
22
|
updateSettings,
|
|
23
|
+
syncManagedSettings,
|
|
23
24
|
} from "@/modules/assistant/service";
|
|
24
25
|
import { ownerFacing } from "./action-helpers";
|
|
25
26
|
|
|
@@ -62,20 +63,26 @@ function done(error?: unknown): never {
|
|
|
62
63
|
export async function saveAssistantAction(form: FormData): Promise<void> {
|
|
63
64
|
const provider = text(form, "provider");
|
|
64
65
|
try {
|
|
66
|
+
const authorized = await actor();
|
|
67
|
+
if (provider === "paradise") await syncManagedSettings.call({
|
|
68
|
+
enabled: form.get("enabled") === "1",
|
|
69
|
+
talentSlug: optional(form, "managedTalent") ?? "sienna-rodriguez",
|
|
70
|
+
dailyCapUsd: digits(form, "spendCapCents", 0) / 100,
|
|
71
|
+
}, authorized);
|
|
65
72
|
await updateSettings.call(
|
|
66
73
|
{
|
|
67
74
|
enabled: form.get("enabled") === "1",
|
|
68
|
-
provider: provider === "anthropic" || provider === "openai" ? provider : "none",
|
|
69
|
-
model: optional(form, "model"),
|
|
75
|
+
provider: provider === "anthropic" || provider === "openai" || provider === "paradise" ? provider : "none",
|
|
76
|
+
model: provider === "paradise" ? "paradise-managed-assistant" : optional(form, "model"),
|
|
70
77
|
baseUrl: optional(form, "baseUrl"),
|
|
71
|
-
credentialRef: optional(form, "credentialRef"),
|
|
78
|
+
credentialRef: provider === "paradise" ? "PARADISEMODERN_API_KEY" : optional(form, "credentialRef"),
|
|
72
79
|
inputCentsPerMillion: optionalDigits(form, "inputCentsPerMillion"),
|
|
73
80
|
outputCentsPerMillion: optionalDigits(form, "outputCentsPerMillion"),
|
|
74
|
-
maxOutputTokens: digits(form, "maxOutputTokens", 700),
|
|
81
|
+
maxOutputTokens: provider === "paradise" ? Math.min(600, digits(form, "maxOutputTokens", 600)) : digits(form, "maxOutputTokens", 700),
|
|
75
82
|
displayName: optional(form, "displayName"),
|
|
76
83
|
spendCapCents: digits(form, "spendCapCents", 0),
|
|
77
84
|
spendPeriod:
|
|
78
|
-
text(form, "spendPeriod") === "day"
|
|
85
|
+
provider === "paradise" || text(form, "spendPeriod") === "day"
|
|
79
86
|
? "day"
|
|
80
87
|
: text(form, "spendPeriod") === "week"
|
|
81
88
|
? "week"
|
|
@@ -92,7 +99,7 @@ export async function saveAssistantAction(form: FormData): Promise<void> {
|
|
|
92
99
|
escalateTopics: parseTopics(text(form, "escalateTopics")),
|
|
93
100
|
contactFormPath: optional(form, "contactFormPath"),
|
|
94
101
|
},
|
|
95
|
-
|
|
102
|
+
authorized,
|
|
96
103
|
);
|
|
97
104
|
} catch (error) {
|
|
98
105
|
done(error);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright (C) 2026 Tony Aly
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { listReaderComments } from "@/modules/cms/blog-comments";
|
|
4
|
+
import { blogSettingsCached } from "@/modules/cms/read";
|
|
5
|
+
import type { Translate } from "@/core/i18n";
|
|
6
|
+
import { Button, Field, Input, Select } from "@/ui/primitives";
|
|
7
|
+
import { submitReaderCommentAction } from "./comment-actions";
|
|
8
|
+
|
|
9
|
+
export async function ReaderComments({ pageId, enabled, returnTo, result, locale, t, pageValue }: { pageId: string; enabled: boolean; returnTo: string; result?: string; locale: string; t: Translate; pageValue?: string }) {
|
|
10
|
+
const page = Math.max(1, Math.min(10000, Math.floor(Number(pageValue)) || 1));
|
|
11
|
+
const [comments, settings] = await Promise.all([listReaderComments.call({ pageId, page }, { kind: "anonymous" }), blogSettingsCached()]);
|
|
12
|
+
const open = enabled && settings.commentsEnabled;
|
|
13
|
+
if (!open && !comments.length && page === 1) return null;
|
|
14
|
+
return <section id="comments" className="grid gap-5 border-t border-rule pt-6" aria-labelledby="comments-title"><h2 id="comments-title" className="text-xl font-semibold">{t("blog.comments")}</h2>
|
|
15
|
+
{result === "pending" ? <p role="status">{t("blog.commentReceived")}</p> : result === "error" ? <p role="alert">{t("blog.commentFailed")}</p> : null}
|
|
16
|
+
<ol className="grid list-none gap-5 p-0">{comments.map(comment => <li id={`comment-${comment.id}`} key={comment.id} className="grid gap-2 rounded-lg border border-rule p-4"><p className="flex flex-wrap justify-between gap-3"><strong>{comment.authorName}</strong><time dateTime={comment.createdAt.toISOString()}>{new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(comment.createdAt)}</time></p>{comment.parentId && comments.some(parent => parent.id === comment.parentId) ? <a className="text-sm underline" href={`#comment-${comment.parentId}`}>{t("blog.commentInReplyTo")}</a> : null}<p className="whitespace-pre-wrap break-words">{comment.body}</p></li>)}</ol>
|
|
17
|
+
{page > 1 || comments.length === 100 ? <nav className="flex justify-between gap-4" aria-label={t("blog.comments")}>{page > 1 ? <a className="underline" href={`${returnTo}?commentPage=${page - 1}#comments`}>{t("blog.previous")}</a> : <span />}{comments.length === 100 && page < 10000 ? <a className="underline" href={`${returnTo}?commentPage=${page + 1}#comments`}>{t("blog.next")}</a> : null}</nav> : null}
|
|
18
|
+
{open ? <form action={submitReaderCommentAction} className="grid max-w-xl gap-4"><input type="hidden" name="pageId" value={pageId} /><input type="hidden" name="returnTo" value={returnTo} /><h3 className="text-lg font-semibold">{t("blog.commentLeave")}</h3><p className="text-sm text-ink-muted">{t("blog.commentPrivacy")}</p>
|
|
19
|
+
<Field label={t("blog.name")} htmlFor="comment-name"><Input id="comment-name" name="name" autoComplete="name" required maxLength={200} /></Field><Field label={t("blog.commentEmail")} htmlFor="comment-email"><Input id="comment-email" name="email" type="email" autoComplete="email" required maxLength={320} /></Field>
|
|
20
|
+
{comments.length ? <Field label={t("blog.commentReply")} htmlFor="comment-parent"><Select id="comment-parent" name="parentId"><option value="">{t("blog.none")}</option>{comments.map(comment => <option key={comment.id} value={comment.id}>{comment.authorName}: {comment.body.slice(0, 70)}</option>)}</Select></Field> : null}
|
|
21
|
+
<Field label={t("blog.commentBody")} htmlFor="comment-body"><textarea id="comment-body" name="body" required maxLength={10000} rows={5} className="w-full rounded-md border border-rule bg-surface px-3 py-2 text-ink" /></Field>
|
|
22
|
+
<div hidden aria-hidden="true"><label htmlFor="comment-website">{t("blog.commentWebsite")}</label><input id="comment-website" name="website" tabIndex={-1} autoComplete="off" /></div><Button type="submit">{t("blog.commentSubmit")}</Button>
|
|
23
|
+
</form> : <p>{t("blog.commentClosed")}</p>}
|
|
24
|
+
</section>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// Copyright (C) 2026 Tony Aly
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// The blog's share of the public route (C2.27, C2.28): archive pages for a
|
|
4
|
+
// category, tag or author, and the byline a post carries.
|
|
5
|
+
//
|
|
6
|
+
// An archive is not a stored page, so it is rendered from a block tree built
|
|
7
|
+
// here — a heading, the description, and the same `blogIndex` block the blog
|
|
8
|
+
// page uses, filtered — which keeps one listing implementation and lets the
|
|
9
|
+
// archive inherit everything that block already does (pagination, locale
|
|
10
|
+
// links, dates).
|
|
11
|
+
import type { BlockNode } from "@/modules/cms/blocks/types";
|
|
12
|
+
import type { Translate } from "@/core/i18n";
|
|
13
|
+
|
|
14
|
+
export type BlogArchive = {
|
|
15
|
+
kind: "category" | "tag" | "author" | "date";
|
|
16
|
+
id: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
path: string;
|
|
19
|
+
name: string;
|
|
20
|
+
description: string | null;
|
|
21
|
+
seo: { title?: string; description?: string; noindex?: boolean };
|
|
22
|
+
trail: Array<{ name: string; path: string }>;
|
|
23
|
+
posts: number;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type PostMeta = {
|
|
27
|
+
pageId: string;
|
|
28
|
+
author: { name: string; path: string; bio: string | null } | null;
|
|
29
|
+
categories: Array<{ name: string; path: string }>;
|
|
30
|
+
tags: Array<{ name: string; path: string }>;
|
|
31
|
+
commentsEnabled: boolean;
|
|
32
|
+
publishedAt: Date | null;
|
|
33
|
+
modifiedAt: Date | null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export function archiveBlocks(archive: BlogArchive, postsPerPage: number): BlockNode[] {
|
|
37
|
+
return [
|
|
38
|
+
{ id: "archive-heading", type: "heading", props: { text: archive.name, level: 1, align: "start" } },
|
|
39
|
+
...(archive.description
|
|
40
|
+
? [{ id: "archive-description", type: "text", props: { body: archive.description } }]
|
|
41
|
+
: []),
|
|
42
|
+
{
|
|
43
|
+
id: "archive-posts",
|
|
44
|
+
type: "blogIndex",
|
|
45
|
+
props: {
|
|
46
|
+
prefix: "blog",
|
|
47
|
+
limit: postsPerPage,
|
|
48
|
+
...(archive.kind === "category" ? { category: archive.slug } : {}),
|
|
49
|
+
...(archive.kind === "tag" ? { tag: archive.slug } : {}),
|
|
50
|
+
...(archive.kind === "author" ? { author: archive.slug } : {}),
|
|
51
|
+
...(archive.kind === "date" ? { date: archive.slug.replaceAll("/", "-") } : {}),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function archiveEyebrow(archive: BlogArchive, t: Translate): string {
|
|
58
|
+
return t(`blog.archive.${archive.kind}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Byline under a post's title: author, dates, categories. */
|
|
62
|
+
export function PostByline({
|
|
63
|
+
meta,
|
|
64
|
+
t,
|
|
65
|
+
locale,
|
|
66
|
+
href,
|
|
67
|
+
}: {
|
|
68
|
+
meta: PostMeta;
|
|
69
|
+
t: Translate;
|
|
70
|
+
locale: string;
|
|
71
|
+
href: (path: string) => string;
|
|
72
|
+
}) {
|
|
73
|
+
const format = (date: Date) => new Intl.DateTimeFormat(locale, { dateStyle: "long" }).format(date);
|
|
74
|
+
const updated =
|
|
75
|
+
meta.modifiedAt && meta.publishedAt && meta.modifiedAt.getTime() - meta.publishedAt.getTime() > 24 * 60 * 60 * 1000
|
|
76
|
+
? meta.modifiedAt
|
|
77
|
+
: null;
|
|
78
|
+
return (
|
|
79
|
+
<p className="flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-ink-muted">
|
|
80
|
+
{meta.author ? (
|
|
81
|
+
<span>
|
|
82
|
+
{t("blog.by")}{" "}
|
|
83
|
+
<a className="font-medium text-ink underline underline-offset-4" href={href(`/${meta.author.path}`)} rel="author">
|
|
84
|
+
{meta.author.name}
|
|
85
|
+
</a>
|
|
86
|
+
</span>
|
|
87
|
+
) : null}
|
|
88
|
+
{meta.publishedAt ? (
|
|
89
|
+
<span>
|
|
90
|
+
<time dateTime={meta.publishedAt.toISOString()}>{format(meta.publishedAt)}</time>
|
|
91
|
+
</span>
|
|
92
|
+
) : null}
|
|
93
|
+
{updated ? (
|
|
94
|
+
<span>
|
|
95
|
+
{t("blog.updated")} <time dateTime={updated.toISOString()}>{format(updated)}</time>
|
|
96
|
+
</span>
|
|
97
|
+
) : null}
|
|
98
|
+
{meta.categories.length ? (
|
|
99
|
+
<span className="flex flex-wrap gap-x-2">
|
|
100
|
+
{meta.categories.map((category) => (
|
|
101
|
+
<a key={category.path} className="underline underline-offset-4" href={href(`/${category.path}`)}>
|
|
102
|
+
{category.name}
|
|
103
|
+
</a>
|
|
104
|
+
))}
|
|
105
|
+
</span>
|
|
106
|
+
) : null}
|
|
107
|
+
</p>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Tags and the author's note, after the post. */
|
|
112
|
+
export function PostFooter({
|
|
113
|
+
meta,
|
|
114
|
+
t,
|
|
115
|
+
href,
|
|
116
|
+
}: {
|
|
117
|
+
meta: PostMeta;
|
|
118
|
+
t: Translate;
|
|
119
|
+
href: (path: string) => string;
|
|
120
|
+
}) {
|
|
121
|
+
if (!meta.tags.length && !meta.author?.bio) return null;
|
|
122
|
+
return (
|
|
123
|
+
<footer className="grid gap-4 border-t border-rule pt-6">
|
|
124
|
+
{meta.tags.length ? (
|
|
125
|
+
<nav aria-label={t("blog.tags")}>
|
|
126
|
+
<ul className="flex list-none flex-wrap gap-2 p-0">
|
|
127
|
+
{meta.tags.map((tag) => (
|
|
128
|
+
<li key={tag.path}>
|
|
129
|
+
<a
|
|
130
|
+
className="inline-flex rounded-full border border-rule px-3 py-1 text-sm text-ink underline-offset-4 hover:underline"
|
|
131
|
+
href={href(`/${tag.path}`)}
|
|
132
|
+
rel="tag"
|
|
133
|
+
>
|
|
134
|
+
{tag.name}
|
|
135
|
+
</a>
|
|
136
|
+
</li>
|
|
137
|
+
))}
|
|
138
|
+
</ul>
|
|
139
|
+
</nav>
|
|
140
|
+
) : null}
|
|
141
|
+
{meta.author?.bio ? (
|
|
142
|
+
<section aria-label={t("blog.aboutAuthor")} className="grid gap-1 text-sm">
|
|
143
|
+
<p className="font-semibold text-ink">
|
|
144
|
+
<a className="underline underline-offset-4" href={href(`/${meta.author.path}`)}>
|
|
145
|
+
{meta.author.name}
|
|
146
|
+
</a>
|
|
147
|
+
</p>
|
|
148
|
+
<p className="max-w-prose text-ink-muted">{meta.author.bio}</p>
|
|
149
|
+
</section>
|
|
150
|
+
) : null}
|
|
151
|
+
</footer>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (C) 2026 Tony Aly
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
"use server";
|
|
4
|
+
import { redirect } from "next/navigation";
|
|
5
|
+
import { submitReaderComment } from "@/modules/cms/blog-comments";
|
|
6
|
+
|
|
7
|
+
export async function submitReaderCommentAction(form: FormData) {
|
|
8
|
+
const value = (key: string) => { const field = form.get(key); return typeof field === "string" ? field.trim() : ""; };
|
|
9
|
+
const back = value("returnTo");
|
|
10
|
+
const path = back.startsWith("/") && !back.startsWith("//") && !/[\\\r\n]/.test(back) ? back.split(/[?#]/)[0]! : "/";
|
|
11
|
+
let result = "pending";
|
|
12
|
+
try {
|
|
13
|
+
await submitReaderComment.call({ pageId: value("pageId"), parentId: value("parentId") || null, name: value("name"), email: value("email"), body: value("body"), website: value("website") }, { kind: "anonymous" });
|
|
14
|
+
} catch { result = "error"; }
|
|
15
|
+
redirect(`${path}?comment=${result}#comments`);
|
|
16
|
+
}
|