Преглед изворни кода

Move header inclusion into default_master

Frans Bergman пре 4 година
родитељ
комит
7fea06e8a1
3 измењених фајлова са 19 додато и 18 уклоњено
  1. 0 1
      bin/wesh.sh
  2. 10 0
      lib/default_master.tpl
  3. 9 17
      lib/headers.tpl

+ 0 - 1
bin/wesh.sh

@@ -13,6 +13,5 @@ else
     printf "Content-Type: text/html\n"
     printf "\n"
 
-    handler lib/headers.tpl
     handler lib/default_master.tpl
 fi

+ 10 - 0
lib/default_master.tpl

@@ -1,3 +1,10 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+% handler $(get_lib_file headers.tpl)
+</head>
+<body>
+
 <div id="header">
     <div class="superHeader">
 % cat $(get_lib_file top_bar.inc)
@@ -25,3 +32,6 @@
 <div id="footer">
 % cat $(get_lib_file footer.inc)
 </div>
+
+</body>
+</html>

+ 9 - 17
lib/headers.tpl

@@ -1,24 +1,20 @@
-<!DOCTYPE HTML>
-<html>
-<head>
+<title>%($pageTitle%)</title>
 
-    <title>%($pageTitle%)</title>
-
-    <link rel="stylesheet" href="/pub/style/style.css" type="text/css" media="screen, handheld" title="default">
-    <link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon">
+<link rel="stylesheet" href="/pub/style/style.css" type="text/css" media="screen, handheld" title="default">
+<link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon">
 % if [ -f $sitedir/_werc/pub/style.css ]; then
-    <link rel="stylesheet" href="/_werc/pub/style.css" type="text/css" media="screen" title="default">'
+<link rel="stylesheet" href="/_werc/pub/style.css" type="text/css" media="screen" title="default">'
 % fi
 
-    <meta charset="UTF-8">
+<meta charset="UTF-8">
 % # Legacy charset declaration for backards compatibility with non-html5 browsers.
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
 
 % if [ -z $meta_description ]; then
-    <meta name="description" content="%($meta_description%)">
+<meta name="description" content="%($meta_description%)">
 % fi
 % if [ -z $meta_keywords ]; then
-    <meta name="keywords" content="%($meta_keywords%)">
+<meta name="keywords" content="%($meta_keywords%)">
 % fi
 
 % h="$(get_lib_file headers.inc)"
@@ -26,8 +22,4 @@
 %   cat "$h"
 % fi
 
-    %($extraHeaders%)
-
-</head>
-<body>
-
+%($extraHeaders%)