start work on sidenotes

This commit is contained in:
2026-03-05 21:39:22 -05:00
parent 13d0ac8de7
commit 7acf1f2c9f
13 changed files with 30 additions and 337 deletions

7
src/middleware.ts Normal file
View File

@@ -0,0 +1,7 @@
import { defineMiddleware } from 'astro:middleware';
// set SIDENOTE_COUNT to 0 at the start of every request so that as sidenotes are rendered, it only counts them on the current page
export const onRequest = defineMiddleware((_context, next) => {
globalThis.SIDENOTE_COUNT = 0;
return next();
})