Most static-site renderers do a fine job until you want one weird thing. In my case it was inline footnote popovers that worked without JavaScript. So I sat down on Saturday morning and wrote my own.
The trick was treating footnote refs as a first-class node type during the parse pass.