File: gen_page.sh

package info (click to toggle)
tup 0.7.8-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 18,448 kB
  • sloc: ansic: 217,845; sh: 17,432; perl: 184; python: 67; lisp: 63; makefile: 62
file content (60 lines) | stat: -rwxr-xr-x 1,104 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/sh -e

analytics=0
if [ $1 = "-a" ]; then
	analytics=1
	shift
fi
menu=""
if [ $1 = "-m" ]; then
	shift
	menu=$1
	shift
fi
text=`./gen_text.sh $1`
cat << HERE
<html>
<head>
	<title>tup | $text</title>
	<link rel="stylesheet" type="text/css" href="tup.css"/>
</head>
<body>

<div id="header">
  <img src="logo.png">
  <!-- fork me on github logo? -->
</div>
<div id="content">
HERE

cat $menu
echo "<h1>$text</h1>"

cat $1

cat << HERE
<div style="clear:both;"></div>
</div>
<div id="footer">&copy; 2008-2016 Mike Shal. All Rights Reserved.</div>
HERE

if [ $analytics = "1" ]; then
cat << HERE
<script type="text/javascript">
	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-171695-12']);
	_gaq.push(['_trackPageview']);

	(function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	})();
</script>
HERE
fi

cat << HERE
</body>
</html>
HERE