Reputation: 2768
I have 3 HTML pages for my website. They all have large parts that are the same. Is there a way I can link them to another HTML file so I only have to make changes once, just like you can do with JavaScript and CSS?
This is what I mean by the JavaScript and CSS:
<link type="text/css" rel="stylesheet" href="template.css" />
<script src="js.js" type="text/javascript"></script>
Upvotes: 0
Views: 128
Reputation: 10249
There are static generators: jekyll, webgen
(Based on a question I asked a long time ago: What is the best way to manage duplicate code in static HTML websites)
Upvotes: 0
Reputation: 2426
The best way to do this is to leverage server-side includes:
In PHP - http://php.net/manual/en/function.include.php
You can use frames (ew) if you need to do this strictly with HTML as well, but I would highly recommend against it!
Upvotes: 2