This seems like a very complicated way to maintain a menu on a static website. Have you considered using old school server side includes? It’s what they were designed for.
server side includes are just a variant of the backend framework. they have the same problem. i'd still be locked in. and i'd depend on and have to maintain a backend for the lifetime of the site.