fix(docs): refine header links and copy feedback

This commit is contained in:
Dax Raad
2026-08-25 00:52:54 -04:00
parent f327adb0f2
commit e9b5e055f5
2 changed files with 16 additions and 5 deletions
@@ -61,6 +61,9 @@ const canonical = new URL(Astro.url.pathname, "https://opencode.ai").href
<rect x="8" y="8" width="13" height="13" rx="2" />
<path d="M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3" />
</svg>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">
<path d="m5 12 4 4L19 6" />
</svg>
</button>
</h1>
<slot />
@@ -94,15 +97,15 @@ const canonical = new URL(Astro.url.pathname, "https://opencode.ai").href
if (!(event.target instanceof Element)) return
const button = event.target.closest<HTMLButtonElement>("[data-copy-markdown]")
if (!button) return
const response = await fetch(window.location.href, { headers: { Accept: "text/markdown" } })
if (!response.ok) return
await navigator.clipboard.writeText(await response.text())
button.dataset.copied = "true"
button.setAttribute("aria-label", "Copied")
window.setTimeout(() => {
delete button.dataset.copied
button.setAttribute("aria-label", "Copy page as Markdown")
}, 1500)
const response = await fetch(window.location.href, { headers: { Accept: "text/markdown" } })
if (!response.ok) return
await navigator.clipboard.writeText(await response.text())
})
</script>
</body>
+10 -2
View File
@@ -158,8 +158,7 @@ a:hover {
color: var(--foreground);
}
.site-header nav a[aria-current="page"] {
border-bottom: 1px solid;
.site-header a:hover {
text-decoration: none;
}
@@ -1012,6 +1011,15 @@ main {
color: var(--foreground);
}
.prose h1 button svg:last-child,
.prose h1 button[data-copied] svg:first-child {
display: none;
}
.prose h1 button[data-copied] svg:last-child {
display: block;
}
.search-dialog {
width: min(42rem, calc(100% - 2rem));
max-height: min(36rem, calc(100vh - 4rem));