Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Docs in the shape of docs.continue.dev | 1 | --- |
| 2 | // A page's title, what it is about beneath it, and a way to take the page | |
| 3 | // to an AI assistant: copied as Markdown, read as Markdown, or opened in | |
| 4 | // Claude or ChatGPT. | |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 5 | import { ArrowUpRight, ChevronDown, Copy, FileText, MessageSquare } from '@lucide/astro'; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 6 | |
| Docs in the shape of docs.continue.dev | 7 | const { entry, id } = Astro.locals.starlightRoute; |
| 8 | const { title, description } = entry.data; | |
| 9 | const markdown = `/${id === '' || id === 'index' ? 'index' : id}.md`; | |
| 10 | const absolute = new URL(markdown, Astro.site).href; | |
| 11 | const ask = encodeURIComponent(`Read ${absolute} so I can ask questions about it.`); | |
| 12 | --- | |
| 13 | ||
| 14 | <div class="g1t-page-title"> | |
| 15 | <div class="g1t-page-title-row"> | |
| 16 | <h1 id="_top">{title}</h1> | |
| Docs: the search stays centred on every page, and the site works on a phone | 17 | <div class="g1t-copy not-content" data-pagefind-ignore> |
| Docs in the shape of docs.continue.dev | 18 | <button type="button" class="g1t-copy-main" data-markdown={markdown}> |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 19 | <Copy /> |
| Docs in the shape of docs.continue.dev | 20 | <span>Copy page</span> |
| 21 | </button> | |
| 22 | <details class="g1t-copy-more"> | |
| 23 | <summary aria-label="More ways to use this page"> | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 24 | <ChevronDown /> |
| Docs in the shape of docs.continue.dev | 25 | </summary> |
| 26 | <div class="g1t-copy-menu"> | |
| 27 | <a href={markdown} target="_blank" rel="noopener"> | |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 28 | <FileText class="g1t-copy-icon" /> |
| 29 | <span class="g1t-copy-text"><strong>View as Markdown</strong><small>This page as plain text</small></span> | |
| Docs in the shape of docs.continue.dev | 30 | </a> |
| 31 | <a href={`https://claude.ai/new?q=${ask}`} target="_blank" rel="noopener"> | |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 32 | <MessageSquare class="g1t-copy-icon" /> |
| 33 | <span class="g1t-copy-text"><strong>Open in Claude</strong><small>Ask questions about this page</small></span> | |
| 34 | <ArrowUpRight class="g1t-copy-out" /> | |
| Docs in the shape of docs.continue.dev | 35 | </a> |
| 36 | <a href={`https://chatgpt.com/?hints=search&q=${ask}`} target="_blank" rel="noopener"> | |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 37 | <MessageSquare class="g1t-copy-icon" /> |
| 38 | <span class="g1t-copy-text"><strong>Open in ChatGPT</strong><small>Ask questions about this page</small></span> | |
| 39 | <ArrowUpRight class="g1t-copy-out" /> | |
| Docs in the shape of docs.continue.dev | 40 | </a> |
| 41 | </div> | |
| 42 | </details> | |
| 43 | </div> | |
| 44 | </div> | |
| 45 | {description && <p class="g1t-description">{description}</p>} | |
| 46 | </div> | |
| 47 | ||
| 48 | <script> | |
| 49 | document.querySelectorAll<HTMLButtonElement>('.g1t-copy-main').forEach((button) => { | |
| 50 | button.addEventListener('click', async () => { | |
| 51 | const label = button.querySelector('span')!; | |
| 52 | try { | |
| 53 | const text = await (await fetch(button.dataset.markdown!)).text(); | |
| 54 | await navigator.clipboard.writeText(text); | |
| 55 | label.textContent = 'Copied'; | |
| 56 | } catch { | |
| 57 | label.textContent = 'Could not copy'; | |
| 58 | } | |
| 59 | setTimeout(() => (label.textContent = 'Copy page'), 1600); | |
| 60 | }); | |
| 61 | }); | |
| 62 | // A menu closes when you click elsewhere. | |
| 63 | document.addEventListener('click', (event) => { | |
| 64 | document.querySelectorAll<HTMLDetailsElement>('.g1t-copy-more[open]').forEach((menu) => { | |
| 65 | if (!menu.contains(event.target as Node)) menu.open = false; | |
| 66 | }); | |
| 67 | }); | |
| 68 | </script> | |
| 69 | ||
| 70 | <style> | |
| 71 | .g1t-page-title { | |
| 72 | margin-top: 0.75rem; | |
| 73 | } | |
| 74 | .g1t-page-title-row { | |
| 75 | display: flex; | |
| 76 | align-items: flex-start; | |
| 77 | justify-content: space-between; | |
| 78 | gap: 1.5rem; | |
| 79 | } | |
| 80 | h1 { | |
| 81 | margin: 0; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 82 | font-family: var(--g1t-font-display); |
| 83 | font-optical-sizing: auto; | |
| Docs in the shape of docs.continue.dev | 84 | font-size: 2rem; |
| 85 | font-weight: 600; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 86 | letter-spacing: -0.015em; |
| Docs in the shape of docs.continue.dev | 87 | line-height: 1.2; |
| 88 | color: var(--g1t-fg); | |
| 89 | } | |
| 90 | .g1t-description { | |
| 91 | margin-top: 0.6rem; | |
| 92 | max-width: 42rem; | |
| 93 | font-size: 1.125rem; | |
| 94 | line-height: 1.55; | |
| 95 | color: var(--g1t-muted); | |
| 96 | } | |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 97 | /* A button group: one bordered box, both parts the same height, and a |
| 98 | divider that runs the box's full height. */ | |
| Docs in the shape of docs.continue.dev | 99 | .g1t-copy { |
| 100 | position: relative; | |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 101 | display: inline-flex; |
| 102 | align-items: stretch; | |
| Docs in the shape of docs.continue.dev | 103 | flex-shrink: 0; |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 104 | height: 2rem; |
| Docs in the shape of docs.continue.dev | 105 | margin-top: 0.35rem; |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 106 | border: 1px solid var(--g1t-line); |
| Docs in the shape of docs.continue.dev | 107 | border-radius: 0.5rem; |
| 108 | } | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 109 | .g1t-copy :global(svg) { |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 110 | display: block; |
| 111 | flex-shrink: 0; | |
| 112 | width: 0.875rem; | |
| 113 | height: 0.875rem; | |
| 114 | } | |
| 115 | .g1t-copy-more { | |
| 116 | display: flex; | |
| 117 | margin: 0; | |
| Docs in the shape of docs.continue.dev | 118 | } |
| 119 | .g1t-copy-main, | |
| 120 | .g1t-copy-more summary { | |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 121 | display: inline-flex; |
| Docs in the shape of docs.continue.dev | 122 | align-items: center; |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 123 | justify-content: center; |
| 124 | gap: 0.375rem; | |
| 125 | height: 100%; | |
| 126 | margin: 0; | |
| Docs in the shape of docs.continue.dev | 127 | border: 0; |
| 128 | background: transparent; | |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 129 | padding: 0 0.625rem; |
| Docs in the shape of docs.continue.dev | 130 | font: inherit; |
| 131 | font-size: 0.8125rem; | |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 132 | font-weight: 500; |
| 133 | line-height: 1; | |
| Docs in the shape of docs.continue.dev | 134 | color: var(--g1t-muted); |
| 135 | cursor: pointer; | |
| 136 | transition: color 0.15s, background 0.15s; | |
| 137 | } | |
| 138 | .g1t-copy-main { | |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 139 | border-radius: calc(0.5rem - 1px) 0 0 calc(0.5rem - 1px); |
| Docs in the shape of docs.continue.dev | 140 | } |
| 141 | .g1t-copy-more summary { | |
| 142 | list-style: none; | |
| 143 | border-left: 1px solid var(--g1t-line); | |
| Docs: Copy page is one button group, both halves full height, icon and text centred | 144 | border-radius: 0 calc(0.5rem - 1px) calc(0.5rem - 1px) 0; |
| 145 | padding-inline: 0.5rem; | |
| 146 | } | |
| 147 | .g1t-copy-main:focus-visible, | |
| 148 | .g1t-copy-more summary:focus-visible { | |
| 149 | outline: 2px solid var(--g1t-accent, currentColor); | |
| 150 | outline-offset: -2px; | |
| Docs in the shape of docs.continue.dev | 151 | } |
| 152 | .g1t-copy-more summary::-webkit-details-marker { | |
| 153 | display: none; | |
| 154 | } | |
| 155 | .g1t-copy-main:hover, | |
| 156 | .g1t-copy-more summary:hover { | |
| 157 | background: var(--g1t-surface); | |
| 158 | color: var(--g1t-fg); | |
| 159 | } | |
| 160 | .g1t-copy-menu { | |
| 161 | position: absolute; | |
| 162 | top: calc(100% + 0.4rem); | |
| 163 | right: 0; | |
| 164 | z-index: 10; | |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 165 | width: 16.5rem; |
| Docs in the shape of docs.continue.dev | 166 | border-radius: 0.75rem; |
| 167 | padding: 0.35rem; | |
| 168 | background: var(--g1t-raised); | |
| 169 | box-shadow: | |
| 170 | inset 0 0 0 1px var(--g1t-line-strong), | |
| 171 | 0 12px 32px rgb(0 0 0 / 0.45); | |
| 172 | } | |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 173 | /* Its own spacing: the page's prose rules stop at not-content, and |
| 174 | nothing inside keeps a margin of its own. */ | |
| 175 | .g1t-copy-menu * { | |
| 176 | margin: 0; | |
| 177 | } | |
| Docs in the shape of docs.continue.dev | 178 | .g1t-copy-menu a { |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 179 | display: flex; |
| 180 | align-items: flex-start; | |
| 181 | gap: 0.6rem; | |
| Docs in the shape of docs.continue.dev | 182 | border-radius: 0.5rem; |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 183 | padding: 0.5rem 0.6rem; |
| Docs in the shape of docs.continue.dev | 184 | text-decoration: none; |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 185 | transition: background 0.15s; |
| Docs in the shape of docs.continue.dev | 186 | } |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 187 | .g1t-copy-menu a + a { |
| 188 | margin-top: 0.1rem; | |
| 189 | } | |
| Docs in the shape of docs.continue.dev | 190 | .g1t-copy-menu a:hover { |
| 191 | background: var(--g1t-surface); | |
| 192 | } | |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 193 | .g1t-copy-menu :global(.g1t-copy-icon) { |
| 194 | flex-shrink: 0; | |
| 195 | margin-top: 0.15rem; | |
| 196 | color: var(--g1t-faint); | |
| 197 | } | |
| 198 | .g1t-copy-menu :global(.g1t-copy-out) { | |
| 199 | flex-shrink: 0; | |
| 200 | margin-left: auto; | |
| 201 | margin-top: 0.15rem; | |
| 202 | width: 0.8rem; | |
| 203 | height: 0.8rem; | |
| 204 | color: var(--g1t-faint); | |
| 205 | opacity: 0; | |
| 206 | transition: opacity 0.15s; | |
| 207 | } | |
| 208 | .g1t-copy-menu a:hover :global(.g1t-copy-out) { | |
| 209 | opacity: 1; | |
| 210 | } | |
| 211 | .g1t-copy-text { | |
| 212 | display: flex; | |
| 213 | min-width: 0; | |
| 214 | flex-direction: column; | |
| 215 | gap: 0.1rem; | |
| 216 | line-height: 1.3; | |
| 217 | } | |
| Docs in the shape of docs.continue.dev | 218 | .g1t-copy-menu strong { |
| 219 | font-size: 0.8125rem; | |
| 220 | font-weight: 500; | |
| 221 | color: var(--g1t-fg); | |
| 222 | } | |
| The docs' Copy page menu keeps its own spacing, with an icon per item | 223 | .g1t-copy-menu small { |
| Docs in the shape of docs.continue.dev | 224 | font-size: 0.75rem; |
| 225 | color: var(--g1t-faint); | |
| 226 | } | |
| Docs: the search stays centred on every page, and the site works on a phone | 227 | /* Phones: the group keeps its place beside the title, as two square |
| 228 | buttons a finger can hit; the copy button shows only its icon, and | |
| 229 | its label stays for screen readers. */ | |
| Docs in the shape of docs.continue.dev | 230 | @media (max-width: 40rem) { |
| Docs: the search stays centred on every page, and the site works on a phone | 231 | .g1t-page-title-row { |
| 232 | gap: 0.75rem; | |
| 233 | } | |
| 234 | h1 { | |
| 235 | min-width: 0; | |
| 236 | font-size: 1.75rem; | |
| 237 | overflow-wrap: anywhere; | |
| 238 | } | |
| Docs in the shape of docs.continue.dev | 239 | .g1t-copy { |
| Docs: the search stays centred on every page, and the site works on a phone | 240 | height: 2.5rem; |
| 241 | margin-top: 0; | |
| 242 | } | |
| 243 | .g1t-copy-main span { | |
| 244 | position: absolute; | |
| 245 | width: 1px; | |
| 246 | height: 1px; | |
| 247 | overflow: hidden; | |
| 248 | clip-path: inset(50%); | |
| 249 | white-space: nowrap; | |
| 250 | } | |
| 251 | .g1t-copy-main, | |
| 252 | .g1t-copy-more summary { | |
| 253 | width: 2.5rem; | |
| 254 | padding: 0; | |
| 255 | } | |
| 256 | .g1t-copy :global(svg) { | |
| 257 | width: 1rem; | |
| 258 | height: 1rem; | |
| 259 | } | |
| 260 | .g1t-copy-menu { | |
| 261 | width: min(16.5rem, calc(100vw - 2rem)); | |
| 262 | } | |
| 263 | .g1t-copy-menu a { | |
| 264 | padding-block: 0.65rem; | |
| Docs in the shape of docs.continue.dev | 265 | } |
| 266 | } | |
| 267 | </style> |