mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-26 19:31:39 -04:00
fix(docs): refine header links and copy feedback
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user