Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/docs-site/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ function sidebar(page, nav, activeTab) {
const copy = homeStringsForLocale(page.locale);
return `<aside class="sidebar">
<div class="sidebar-head"><a class="brand sidebar-brand" href="${pageUrl(allPageByKey.get(pageKey(page.locale, "index")) ?? page)}" aria-label="OpenClaw Docs"><img src="${publicPath("/assets/openclaw.svg")}" alt=""><span class="brand-name">OpenClaw</span><span class="brand-tag">Docs</span></a><button class="sidebar-close" type="button" data-nav-close aria-label="${escapeAttr(copy.controls[3])}">${icon("x")}</button></div>
<nav class="sidebar-support" aria-label="Official OpenClaw support"><a href="${supportUrl}">Support</a></nav>
${rewriteInternalUrls(docsQuickNav(page.slug, icon, page.locale), page.locale)}
<nav class="docs-sections" aria-label="${escapeAttr(copy.navigation[6])}" data-back-label="${escapeAttr(copy.controls[4])}" data-sections-label="${escapeAttr(copy.navigation[6])}">${nav.map((tab) => {
const current = tab.title === activeTab;
Expand Down
5 changes: 1 addition & 4 deletions scripts/docs-site/docs-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@
.docs-layout .search-button:hover { background: var(--paper); border-color: color-mix(in srgb,var(--ink) 22%,transparent); }}

.sidebar-tools { display: none; }
.sidebar-support { flex-shrink: 0; margin-block-end: 12px; }
.sidebar-support a { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid var(--docs-border); color: var(--ink); font: 500 13px/1.5 var(--oc-font-body); text-decoration: none; }
.sidebar-support a:hover { background: var(--paper); }
.sidebar-support a:focus-visible, .page-support a:focus-visible { outline: 2px solid var(--oc-focus-ring); outline-offset: 3px; }
.page-support a:focus-visible { outline: 2px solid var(--oc-focus-ring); outline-offset: 3px; }
.docs-layout .page-support { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-block: 32px 0; padding: 16px; border: 1px solid var(--docs-border); color: var(--docs-muted); font: 400 14px/1.5 var(--oc-font-body); }
.page-support p { margin: 0; }
.page-support a { flex-shrink: 0; color: var(--ink); font-weight: 500; text-underline-offset: 4px; }
Expand Down
2 changes: 1 addition & 1 deletion scripts/docs-site/preview-build.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ test("requested pages outside navigation fit inside the 30-page preview, includi
const supportUrl = 'https://community.openclaw.ai/';
for (const scope of [
html.match(/<nav class="network-nav"[\s\S]*?<\/nav>/)[0],
html.match(/<aside class="sidebar">[\s\S]*?<\/aside>/)[0],
html.match(/<footer class="site-footer">[\s\S]*?<\/footer>/)[0],
]) {
assert.ok(scope.includes(`href="${supportUrl}">Support</a>`), 'persistent official support link');
Expand All @@ -50,6 +49,7 @@ test("requested pages outside navigation fit inside the 30-page preview, includi
assert.match(html, /Page source and issue[\s\S]*?Raise issue/);
assert.match(html, /https:\/\/discord\.com\/invite\/clawd/);
const sidebar = html.match(/<aside class="sidebar">([\s\S]*?)<\/aside>/)[1];
assert.doesNotMatch(sidebar, /sidebar-support|>Support<\/a>/, 'no duplicate sidebar support button');
assert.equal([...sidebar.slice(sidebar.indexOf('<nav class="docs-sections"')).matchAll(/class="nav-link/g)].length, 35);
assert.match(sidebar, /href="\/guide\/page-0"/);
assert.match(sidebar, /href="https:\/\/docs\.openclaw\.ai\/guide\/page-34" data-preview-live/);
Expand Down
5 changes: 4 additions & 1 deletion scripts/docs-site/smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,10 @@ if (/\.oc-card:first-child\{border-color:var\(--brand\)/.test(siteCss)) {
throw new Error("assets: first card is hard-highlighted");
}
const footer = DomUtils.findOne((node) => node.name === "footer", indexDocument.children);
for (const className of ["network-nav", "sidebar-support", "site-footer", "page-support"]) {
if (DomUtils.findOne((node) => node.attribs?.class?.split(" ").includes("sidebar-support"), indexDocument.children)) {
throw new Error("sidebar: duplicate support button must not be rendered");
}
for (const className of ["network-nav", "site-footer", "page-support"]) {
const scope = DomUtils.findOne((node) => node.attribs?.class?.split(" ").includes(className), indexDocument.children);
const supportLink = scope && DomUtils.findOne((node) => node.name === "a"
&& node.attribs.href === "https://community.openclaw.ai/"
Expand Down
Loading