> I think the whole benefit of a static website generator in general is to avoid the "I copy/paste the same header/footer on each" step, especially copy-pasting the menu/header, as your menu can change as you add new pages / blog posts.
If the website is simple, you could use iframes for headers and footers.
Re:A static website with React
by tokenizerrr on Friday February 17, 2017 @11:53AM
(#13669687)
Except that iframes introduce additional http requests, difficulties with selecting text and all the other annoyances that come with them.
Re:A static website with React
by tonyedgecombe on Friday February 17, 2017 @02:08PM
(#13670821)
I'm surprised html doesn't have an include tag.
https://en.wikipedia.org/wiki/Server_Side_Includes
<!--#include virtual="../snippet.html" -->
Most servers that you would get for a shared host (ie Apache, NGINX) support this.Whoa. Flashbacks to SHTML.
I'm annoyed but not surprised. This is how a lot of HTML was developed.
First, you have a need. Then you get a crippled native "solution", that emerges from some committee and therefore doesn't really solve anything. In lieu of alternatives, a lot of people use it anyway. Then the problem is ignored long enough so other people come up with hacks to solve the same problem slightly less bad. Then the problem is ignored semi-permanently because 'hey, you can just use one of those hacks!'. (Look up iframe seamless attribute.)
I can see good benefits of having a way to do static site generation with the React ecosystem if you're already familiar with it.