#region head
-// TODO: get the header and idk
+// get head data
+$head_data = file_get_contents(URL . '?sheet=_header');
+$head_data = json_decode($head_data, true);
$head_path = $partialsPath . "/head.html";
$generator->writeToFile($head_path, '
<!DOCTYPE html>
<html lang="' . $generator->templateVar("lang-code") . '">
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+<head>');
+
+foreach ($head_data as $item) {
+ switch ($item['type']) {
+ case 'meta':
+ $generator->writeToFile($head_path, '<meta ' . $item['value'] . '>');
+ break;
+
+ case 'css':
+ $generator->writeToFile($head_path, '<link rel="stylesheet" href="' . $item['value'] . '">');
+ break;
+
+ case 'js':
+ $generator->writeToFile($head_path, '<script src="' . $item['value'] . '"></script>');
+ break;
+ }
+}
+
+$generator->writeToFile($head_path, '
<title>' . $generator->templateVar("page-title") . '</title>
-
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
- <link rel="stylesheet" href="../../assets/css/style.css">
</head>
<body>
');