Expose root Knowledge SEO title

This commit is contained in:
DCCONSTRUCTIONS 2026-07-10 01:51:58 +03:00
parent e31b247128
commit 4c6f133ff1
1 changed files with 7 additions and 1 deletions

View File

@ -5586,6 +5586,11 @@ function renderKnowledgeEditor() {
} }
state.knowledge.settings ||= {}; state.knowledge.settings ||= {};
state.knowledge.seo ||= {};
if (!state.knowledge.seo.title) state.knowledge.seo.title = state.knowledge.title || "Knowledge";
if (!state.knowledge.seo.description && state.knowledge.settings.description) {
state.knowledge.seo.description = state.knowledge.settings.description;
}
const bodyPath = isRoot ? "introHtml" : "bodyHtml"; const bodyPath = isRoot ? "introHtml" : "bodyHtml";
const match = isRoot ? null : findKnowledgeNode(node.id); const match = isRoot ? null : findKnowledgeNode(node.id);
const parentTitle = match?.parent?.title || state.knowledge.title || "База знаний"; const parentTitle = match?.parent?.title || state.knowledge.title || "База знаний";
@ -5634,7 +5639,8 @@ function renderKnowledgeEditor() {
seoGrid.className = "group-grid"; seoGrid.className = "group-grid";
if (isRoot) { if (isRoot) {
seoGrid.append( seoGrid.append(
createKnowledgeInput({ node, path: "settings.description", label: "SEO description / описание", kind: "textarea", wide: true }), createKnowledgeInput({ node, path: "seo.title", label: "SEO title", wide: true }),
createKnowledgeInput({ node, path: "seo.description", label: "SEO description / описание", kind: "textarea", wide: true }),
); );
} else { } else {
node.seo ||= {}; node.seo ||= {};