Skip to content

Site: navigation bar, shared stylesheet, copy buttons - #18

Merged
khsarvar merged 3 commits into
mainfrom
site/navigation
Sep 25, 2026
Merged

khsarvar merged 3 commits into
mainfrom
site/navigation

Conversation

@khsarvar

@khsarvar khsarvar commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

The benchmark page was only reachable from a link inside the comparison section. This adds a navigation bar to every page of the site, plus copy buttons on code blocks.

  • Nav: Siftdog (home) · Quick start · MCP · Benchmark · GitHub. Sticky, current page highlighted (aria-current), wraps to a second row on phones.
  • docs/style.css: the two pages' duplicated inline CSS merged into one stylesheet, plus nav and copy-button styles.
  • docs/site.js (small, shared, defer): a copy icon button on every code block (5 on the homepage, 1 on the benchmark page). Uses the Clipboard API with a select-and-copy fallback, switches to a check mark for 1.5s, appears on hover or keyboard focus on desktop and always on touch screens. Without JavaScript the pages look and work exactly as before.
  • Anchors on homepage sections (#features, #quick-start, #tavily, #mcp, #compare, #faq), with scroll margin so headings clear the sticky bar.
  • The benchmark page's old "← Siftdog" back link is replaced by the nav.
  • Adding a page later: link style.css and site.js, copy the nav block, add one link to each page's nav.

Checked: HTML well-formed and JSON-LD valid; node --check site.js; headless Chrome confirms the buttons are injected on both pages; layout rendered at desktop and 390px. No external requests.

Adds a sticky nav (Sifthound · Quick start · MCP · Benchmark · GitHub) to every
page, with the current page marked, and moves the pages' duplicated inline CSS
into docs/style.css. Homepage sections get anchors (#quick-start, #mcp, ...).
Adding a page means linking style.css and one link in each nav.
docs/site.js wraps each <pre> and adds a Copy button (Clipboard API, with a
select-and-copy fallback); it shows 'Copied' for 1.5s. Buttons appear on
hover or focus on desktop and always on touch screens. Pages work unchanged
without JavaScript.
@khsarvar khsarvar changed the title Site: navigation bar and shared stylesheet Site: navigation bar, shared stylesheet, copy buttons Sep 25, 2026
@khsarvar
khsarvar merged commit 2e989e1 into main Sep 25, 2026
4 checks passed
@khsarvar
khsarvar deleted the site/navigation branch September 25, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant