]> git.donarmstrong.com Git - bugscan.git/commitdiff
factor out common HTML header output into 'html_header' function
authorTomas Pospisek <tpo_hp@sourcepole.ch>
Fri, 23 Jan 2015 23:56:02 +0000 (00:56 +0100)
committerTomas Pospisek <tpo_hp@sourcepole.ch>
Sat, 24 Jan 2015 00:02:55 +0000 (01:02 +0100)
dohtml

diff --git a/dohtml b/dohtml
index 62eea00d27b7ee45a68be73840617b150c64c217..d3a8bd17b45bd8ba49058b6035c57f11c4561359 100755 (executable)
--- a/dohtml
+++ b/dohtml
@@ -2,6 +2,25 @@
 
 htmldir=/org/bugs.debian.org/www/bugscan
 
 
 htmldir=/org/bugs.debian.org/www/bugscan
 
+header() {
+       local   title="$1"      # Title of page
+       local   date="$2"       # Date
+
+       cat <<EOF
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <title>$title, $date</title>
+  </head>
+<body bgcolor="white">
+<h1 align="center">$title</h1>
+
+<h2 align="center">$date</h2>
+
+EOF
+}
+
 realmakepage() {
        local   filter="$1"     # Distributions to list
        local   title="$2"      # Title of page
 realmakepage() {
        local   filter="$1"     # Distributions to list
        local   title="$2"      # Title of page
@@ -18,17 +37,9 @@ realmakepage() {
 
        filter="$filter $worry"
 
 
        filter="$filter $worry"
 
-       cat <<EOF
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>$title, $date</title>
-  </head>
-<body bgcolor="white">
-<h1 align="center">$title</h1>
+       header "$title" "$date"
 
 
-<h2 align="center">$date</h2>
+       cat <<EOF
 
 <p align="center">for distribution(s): $descr</p>
 
 
 <p align="center">for distribution(s): $descr</p>
 
@@ -76,17 +87,10 @@ EOF
 }
 
 makemainpage() {
 }
 
 makemainpage() {
-       cat <<EOF
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>$title, $time</title>
-  </head>
-<body bgcolor="white">
-<h1 align="center">$title</h1>
 
 
-<h2 align="center">$time</h2>
+       header "$title" "$date"
+
+       cat <<EOF
 
 <p align="center">
 EOF
 
 <p align="center">
 EOF