Keyboard Navigation ¶
markata-go sites include comprehensive keyboard shortcuts for power users and those who prefer keyboard navigation. All shortcuts are designed to be intuitive, following conventions from popular tools like Vim and GitHub.
Accessibility: Shortcuts respect user preferences and can be disabled. They never interfere with form inputs or accessibility tools.
Quick Reference ¶ #
Press ? at any time to see the full shortcuts help modal.
Scrolling ¶ #
Navigate through page content using vim-style shortcuts:
| Shortcut | Action |
|---|---|
j |
Scroll down (~2 lines) |
k |
Scroll up (~2 lines) |
d |
Scroll half-page down |
u |
Scroll half-page up |
g g |
Scroll to top of page |
Shift+G |
Scroll to bottom of page |
Note: On feed/list pages with multiple posts, j/k will navigate between posts instead of scrolling.
Feed Navigation ¶ #
When viewing a page with multiple posts (index, archive, tag pages), keyboard navigation lets you browse through posts:
| Shortcut | Action |
|---|---|
j or Down Arrow |
Highlight next post |
k or Up Arrow |
Highlight previous post |
Enter or o |
Open highlighted post |
Shift+O |
Open highlighted post in new tab |
The highlighted post is visually indicated with an outline. Press Escape to clear the highlight.
Go-To Shortcuts ¶ #
GitHub-style two-key sequences for quick navigation:
| Shortcut | Action |
|---|---|
g h |
Go to home page |
g s |
Focus search input |
Press the first key (g), then the second key within 800ms.
Utility Shortcuts ¶ #
| Shortcut | Action |
|---|---|
/ |
Focus search input |
Cmd/Ctrl+K |
Focus search (alternative) |
y y |
Copy current URL to clipboard |
[ |
Go to previous page (pagination) |
] |
Go to next page (pagination) |
? |
Show shortcuts help modal |
Escape |
Close modals, clear highlight, blur inputs |
Accessibility Features ¶ #
Respects User Preferences ¶ #
- Reduced Motion: When
prefers-reduced-motionis enabled, smooth scrolling is disabled for instant navigation. - Input Context: Shortcuts are automatically disabled when typing in text inputs, textareas, or contenteditable elements.
Disable Shortcuts ¶ #
If keyboard shortcuts interfere with your workflow or assistive technology:
- Press
?to open the shortcuts modal - Click “Disable Shortcuts”
This preference is saved in your browser and persists across visits.
Re-enable Shortcuts ¶ #
- Press
?(this still works even when shortcuts are disabled) - Click “Enable Shortcuts”
Customization ¶ #
For Site Owners ¶ #
Keyboard shortcuts are part of the default theme. If you need to customize or extend them:
-
Override the JavaScript: Copy the shortcut modules from
pkg/themes/default/static/js/to yourstatic/js/directory and modify as needed. The main files are:search-shortcuts.js- Search and modal shortcutsnavigation-shortcuts.js- Feed navigation shortcutsscrolling-shortcuts.js- Scrolling shortcutshistory-shortcuts.js- Browser history shortcutsshortcuts-registry.js- Core registry system
-
Add to the modal: Override the
partials/shortcuts-modal.htmltemplate to add your custom shortcuts. -
Styling: The keyboard highlight class
.kb-highlightedcan be customized in your CSS:
/* Custom highlight style */
.kb-highlighted {
outline: 3px solid var(--color-primary);
outline-offset: 4px;
background-color: rgba(var(--color-primary-rgb), 0.1);
}
JavaScript API ¶ #
The shortcuts system exposes functions for programmatic use:
// Show toast notification
markataShortcuts.showToast('Custom message');
// Programmatic scrolling
markataShortcuts.smoothScroll(100); // Scroll down 100px
markataShortcuts.smoothScrollToTop();
markataShortcuts.smoothScrollToBottom();
// Copy URL
markataShortcuts.copyUrlToClipboard();
// Check if shortcuts are disabled
if (!markataShortcuts.areShortcutsDisabled()) {
// Shortcuts are enabled
}
// Modal control
markataShortcuts.showShortcutsModal();
markataShortcuts.hideShortcutsModal();
Browser Compatibility ¶ #
Keyboard shortcuts work in all modern browsers:
- Chrome/Edge 80+
- Firefox 75+
- Safari 13+
The clipboard API (yy to copy URL) requires a secure context (HTTPS or localhost).
See Also ¶ #
- Themes Guide - Theme customization including keyboard shortcuts
- Configuration Guide - Site configuration options
- Accessibility - Accessibility features and best practices