Move code block wrapper creation from deferred JavaScript to a synchronous
inline script at the end of <body>. This ensures the DOM structure is
finalized before the browser's first paint, eliminating the visible "jump"
when code blocks were wrapped after initial render.
Split into two phases:
1. Inline sync script wraps <pre> in .code-block-wrapper before first paint
2. Deferred code-copy.js adds copy buttons to existing wrappers
Co-authored-by: Claude <noreply@anthropic.com>
Check data-lang attribute and code content instead of relying on
stripped language classes. Update comment to reflect current detection
logic for bash/shell code blocks.
Wrap code blocks in a container div so the copy button stays fixed at
the top-right corner when scrolling horizontally. Previously the button
would scroll with the code content.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
Implements a floating copy button that appears on code block hover, with special handling to strip shell prompts from terminal blocks before copying.
New files:
- code-copy.js: Attaches copy buttons to all code blocks, strips leading `$ ` from bash/shell/terminal blocks, shows checkmark feedback for 2 seconds after successful copy
Style updates:
- .code-copy-btn: Positioned absolutely in top-right, hidden by default with opacity transition, styled to match design system colors
- .content pre:hover .code-copy-btn: Reveals button on code block hover
- Button includes copied state with accent color highlight