}
});
+/* Enable pressing spacebar to click <a> links. */
+document.addEventListener('keydown', e => {
+ if (e.code === 'Space' && e.target?.tagName === 'A') {
+ e.preventDefault();
+ e.target.click();
+ }
+});
+
/* Implement client-side routing. Handles view logic for /home and /:post routes. */
async function showPage(path) {
// Determine which placeholders to show
}
});
-/* Enable pressing spacebar to click <a> links. */
-document.addEventListener('keydown', e => {
- if (e.code === 'Space' && e.target?.tagName === 'A') {
- e.preventDefault();
- e.target.click();
- }
-});
-
/* DevTools console help message. */
const ascii =
`┌──────────────────────────────────────────────────────────┐