Adding navbar across all pages

I’ve got a netlify site with a navbar, is there any way i can insert the same navbar on all pages besides like, copy pasting the code on each page?

It’s currently a pure HTML/CSS site, I thought about doing it with Javascript but theres a 1-2 second delay for it to load. I was wondering if there’s any way I could do it from the Netlify side, maybe with React or something but I’m not experienced with that

Any general idea how I could do this? Thanks

@cchris This is more of a general development question, so you may be better off asking it elsewhere.

That said… there’s a multitude of ways you could achieve it.

From a very basic perspective though, what you’re looking to do is “include” the contents of one file, in another file.

So you can google around from that perspective, here’s a random related blog post:

If working with pure HTML/CSS, instead of switching your entire site to a runtime JavaScript framework, you could use any number of build time template systems.

I often use eta which has partials & layouts.

1 Like