I've become a fan of https://htmx.org for this reason.
A small 10KB lib that augments HTML with the essential good stuff (like dynamic imports of static HTML)
A small 10KB lib that augments HTML with the essential good stuff (like dynamic imports of static HTML)
<script>
function includeHTML(url) {
const s = document.currentScript
fetch(url).then(r => r.text()).then(h => {
s.insertAdjacentHTML('beforebegin', h)
s.remove()
})
}
</script>
... <script>
includeHTML('/footer.html')
</script>
The `script` element is replaced with the html from `/footer.html`.there are many examples of HTMX (since it is a self contained and tiny) being used alongside existing frameworks
of course for some of us, since HTMX brings dynamic UX to back end frameworks, it is a way of life https://harcstack.org (warning - raku code may hurt your eyes)
Depending on the specific objection to Javascript, this may or may not matter:
1. You object to any/all JS on a page? Yeah, then this won't work for you.
2. You object to having to write JS just to get client-side includes? This should mostly work for you.
It all depends on what the actual objection is.
$ curl --location --silent "https://unpkg.com/htmx.org@2.0.4" | wc -c
50917
$ curl --location --silent "https://unpkg.com/htmx.org@2.0.4" | gzip --best --stdout | wc -c
16314