-2

I'm currently coding a plain HTML/CSS/JS website (on a Linux desktop) without any dynamically generated code such as PHP but I've run into the problem that if I decide to change the menu or the footer, I have to change it in all (20+) files.

Seeing as including html files with JavaScript is a bit ugly and makes the resulting code unnecessarily complicated, I was wondering if I could write HTML snippets for header, footer, content etc and automatically assemble them using a Makefile or any similar tool.

I have never created Makefiles however, and I don't know whether those would be the tool of choice for this task - any input would be greatly appreciated!

Sora.
  • 1,395
  • 1
  • 11
  • 14
  • Would you mind to explain why this is receiving downvotes? Is there a more appropriate Stack Exchange website for this? – Sora. Sep 14 '18 at 08:44
  • 1
    Almost any build can be performed with Make as a build utility. So your question has a little sence. If you want *suggestions* how to do this, then it is **too broad** for Stack Overflow. Just try to use Make for your project. If you find some step to be difficult, ask about **explicitely** this step. – Tsyvarev Sep 14 '18 at 16:02

1 Answers1

0

Nevermind, I just realized that the easiest solution would probably be writing a bash script and using cat to concatenate file segments. Leaving this open in case someone has a better idea.

Sora.
  • 1,395
  • 1
  • 11
  • 14