diff options
Diffstat (limited to 'build-page')
-rw-r--r-- | build-page | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/build-page b/build-page new file mode 100644 index 0000000..a2ea34e --- /dev/null +++ b/build-page @@ -0,0 +1,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 |