summaryrefslogtreecommitdiff
path: root/build-page
blob: a2ea34ee8a8daecba70d404f6fa56b09f8e38f71 (plain)
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
#!/bin/sh

print_head() 
{
cat << EOF
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel='stylesheet' type='text/css' href="/style.css">
	<title>${1}</title>
</head>
	
<body>
	<a id="header-link" href="/home/index.html">Suleyman Farajli</a>
	<hr class="separator">
	
EOF
}

print_menu()
{
	echo '<div class="menu">'
		<a class="menu_item" href="/index.html">Home/</a>
		<a class="menu_item" href="/software/software.html">Software/</a>
		<a class="menu_item" href="/wiki/wiki.html">Wiki/</a>
	echo '<a class="menu_item  right" href="https://git.farajli.net">Git</a>'
	echo '</div>'
}

print_copyleft()
{
cat << EOF
<p id="copyleft"><br>copyleft (c) 2024 Suleyman Farajli</p>

</body>
</html>"
EOF
}

filename="${1}"
title=$(cat "${filename}" | head -n1 | sed 's/<!-- Title: //; s/-->//')

print_head "${title}"
print_menu
# Remove the title on the first line, if exists
sed '1 s/<!--.*-->//' ${filename} | smu 
print_copyleft