I am having trouble including unique <meta> tags across many pages that share a universal header.
The header is included using PHP where one header.html file is prepended to all of my pages. The pages where initially structured as follows:
The page where header.html is included
<?php include('header.html');?>
<div id="contents">...</div>
<?php include('footer.html');?>
and header.html contained this structure
<html>
<head>
<title>...</title>
<meta>...</meta>
<link>...</link>
<scripts>...</scripts>
</head>
<body>
I am now more aware of the importance of <title> and <meta> tags for many aspects of SEO and I am conscious that these must be properly formatted for each page. To combat this I have now structured my pages like this:
The page where header is included
<html>
<head>
<title>...</title>
<meta>...</meta>
<?php include('header.php');?>
<div id="contents">...</div>
<?php include('footer.html');?>
and header.html contains this new structure
<link>...</link>
<scripts>...</scripts>
</head>
This just seems inefficient and I feel it deviates from the benefits of using PHP includes in the first place.
In all this question my be to broad and not specific enough. How can I include <meta> tags in a page without having to hard code them into every page, achieving the design benefits gained in a template approach? Is there a more modern design approach that overcomes these problems that I could implement?