blob: 1a435e79ff978b3f6e76495ff178f737f625eba4 (
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
50
51
|
#!/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()
{
cat << EOF
<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>
<a class="menu_item right" href="https://git.farajli.net">Git</a>
</div>
EOF
}
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
|