Skip to content

Commit 6ddef23

Browse files
Martin Mahnerclaude
authored andcommitted
Make header title clickable to return to first section
Clicking the documentation title in the header now navigates to the first section and scrolls to the top of the page. This provides an intuitive way for users to return to the beginning of the documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3461c06 commit 6ddef23

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
- Added `scroll-behavior: smooth` for smooth scrolling
2222
- Configured Tocbot with `headingsOffset: 86` for accurate scroll spy detection
2323
- Set `scrollSmooth: false` to let browser handle native scrolling behavior
24+
- **Header title navigation** - Clicking the documentation title now returns to first section and scrolls to top
25+
- Uses Alpine.js to set active section and scroll to page top
26+
- Provides intuitive way to return to beginning of documentation
2427

2528
### Changed
2629

microdocs/templates/default/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<div class="flex flex-col gap-3 sm:flex-row sm:gap-8 sm:items-center">
2727
<!-- Logo/Title -->
2828
<h1 class="font-heading font-semibold text-lg text-gray-900 dark:text-gray-50 sm:text-xl">
29-
<a href="#{{ sections[0].id }}" class="cursor-pointer">{{ title }}</a>
29+
<a @click="activeSection = '{{ sections[0].id }}'; window.scrollTo(0, 0)" class="cursor-pointer">{{ title }}</a>
3030
</h1>
3131

3232
<!-- Navigation -->

templates_src/default/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<div class="flex flex-col gap-3 sm:flex-row sm:gap-8 sm:items-center">
2727
<!-- Logo/Title -->
2828
<h1 class="font-heading font-semibold text-lg text-gray-900 dark:text-gray-50 sm:text-xl">
29-
<a href="#{{ sections[0].id }}" class="cursor-pointer">{{ title }}</a>
29+
<a @click="activeSection = '{{ sections[0].id }}'; window.scrollTo(0, 0)" class="cursor-pointer">{{ title }}</a>
3030
</h1>
3131

3232
<!-- Navigation -->

0 commit comments

Comments
 (0)