Skip to content

feat: add site links, star count and Install App to the header - #99

Merged
shenxianpeng merged 5 commits into
mainfrom
feature/header-nav
Nov 20, 2026
Merged

shenxianpeng merged 5 commits into
mainfrom
feature/header-nav

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

This adds the pieces visitors look for in a dev-tool header:

  • Links: Docs, Rules, Pricing, Blog and Changelog sit beside the brand, and the current section is highlighted. Docs also covers the guides, configuration, recipes, troubleshooting, migration and comparison pages.
  • Star count: the repository's star count appears on the GitHub icon.
  • Install App: a button at the end of the bar, in Ink on the light scheme and near-white on the dark one.

All three come from Sumi 0.4.3's new header_links, header_button and repo_stars theme options (mkdocs-ng/mkdocs-sumi#42). This PR sets them in mkdocs.yml and bumps mkdocs-sumi to 0.4.3.

The build step in deploy.yml now passes GITHUB_TOKEN, so the star lookup stays clear of the anonymous rate limit that runners share. Without the token, the build still passes and the header shows the plain icon.

On narrower screens:

  • From 1100px down, the search box shrinks to its icon.
  • Under 920px, the links and the star count move into the menu.
  • Under 520px, the Install App button moves into the menu too.

Screenshots

Light, desktop

Dark, desktop

Light, narrow

Phone menu

Checks

  • mkdocs build --strict passes with Sumi 0.4.3, and the star count renders (101).
  • No horizontal overflow at 1440, 1200, 1024, 768, 390 or 360px, in either scheme.

Docs, Rules, Pricing, Blog and Changelog sit beside the brand, with the
current section highlighted. The GitHub icon becomes a Star button with
the repository's star count, read at build time and left out when GitHub
can't be reached, and an Install App button ends the bar.

Sumi's header has no setting for any of this, so the site overrides
partials/header.html. Under 920px the links and the star count leave the
bar for the drawer and the plain GitHub icon returns; under 520px the
button goes too.
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for commit-check failed. Why did it fail? →

Name Link
🔨 Latest commit b1a1271
🔍 Latest deploy log https://app.netlify.com/projects/commit-check/deploys/6b002d7d653a938148bb843c

@shenxianpeng shenxianpeng added enhancement New feature or request minor labels Nov 20, 2026 — with Claude
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 005b7c5e-a451-42f2-9223-c09da14f2bd6
Commits

Reviewing files that changed from the base of the PR and between 03ae918 and b1a1271.

Files selected for processing: 3

  • .github/workflows/deploy.yml
  • docs/requirements.txt
  • mkdocs.yml

No actionable comments were generated in the recent review.

Walkthrough

The site build now retrieves and caches GitHub repository star counts for the header, using an optional token. The Sumi header adds configured site links, a repository star link, and an install-app call to action. Responsive CSS changes header controls across viewport widths.

Changes: Site header

Layer / File(s) Summary
Fetch and cache repository stars
scripts/mkdocs_hooks.py, .github/workflows/deploy.yml, tests/mkdocs_hooks_test.py
The build hook fetches and formats GitHub star counts, caches results per repository, and stores them in MkDocs configuration. The deploy step provides GITHUB_TOKEN. Tests cover formatting, lookup failure, and caching.
Configure and render header
mkdocs.yml, docs/overrides/partials/header.html
The configuration adds site links and an install-app call to action. The header renders configured links, navigation tabs, conditional tools, repository stars, and the call to action.
Style responsive header
docs/assets/extra.css
Styles define the appearance of navigation, search, repository links, and the call to action. Breakpoints change search presentation and hide selected controls.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Build as MkDocs build
  participant Hook as on_config
  participant API as GitHub API
  participant Header as header.html
  Build->>Hook: configure repository star count
  Hook->>API: request repository data
  API-->>Hook: return stargazers_count
  Hook->>Hook: format and cache count in config
  Header->>Hook: read repo_stars from config
Loading

Possibly related PRs

Merge Risk: Minimal · previous review 03ae9

The change adds header links, a star count and an Install App button, with a safe fallback when GitHub is unreachable. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat: add site links, star count and Install App to the header" matches the main change. The header partial adds Docs, Rules, Pricing, Blog and Changelog links, a GitHub star-count button, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "feat: add site links, star count and Install App to the header" matches the main change. The header partial adds Docs, Rules, Pricing, Blog and Changelog links, a GitHub star-count button, and an Install App button. The title is specific and concise. The PR also includes CSS responsive rules, a mkdocs config update, and a build-time star-count hook, which the title does not mention, but those support the header change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7ede3de-bb07-4bd3-959b-845288bf4462
Commits

Reviewing files that changed from the base of the PR and between e7f4349 and 03ae918.

Files selected for processing: 6

  • .github/workflows/deploy.yml
  • docs/assets/extra.css
  • docs/overrides/partials/header.html
  • mkdocs.yml
  • scripts/mkdocs_hooks.py
  • tests/mkdocs_hooks_test.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Sumi now has header_links, header_button and repo_stars, so the copied
header partial, the star lookup in the build hooks and their styles go.
The site needs the Sumi release that ships them.
@shenxianpeng
shenxianpeng marked this pull request as draft November 20, 2026 11:16
@shenxianpeng
shenxianpeng marked this pull request as ready for review November 20, 2026 11:22
@shenxianpeng
shenxianpeng merged commit 75896a4 into main Nov 20, 2026
6 of 11 checks passed
@shenxianpeng
shenxianpeng deleted the feature/header-nav branch November 20, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant