diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2024-09-08 19:07:16 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2024-09-08 19:07:16 +0400 |
commit | c38235650e5deb06f578406c3331dda3eab5371b (patch) | |
tree | 6ec4a9b54315a6e8f39b7b78c72692816a675403 | |
parent | f5b53a43b05e561ff22e57d2ba00dfdb1f3b617b (diff) |
Makefile and build-page added
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | build-page | 49 |
2 files changed, 50 insertions, 1 deletions
@@ -1,4 +1,4 @@ -SRC = $(shell find . -name '*.md') +SRC := $(shell find . -name '*.md') HTML = $(SRC:.md=.html) all: $(HTML) 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 |