git3html

git clone https://orangeshoelaces.net/git/git3html.git

b12b321bd79799dbb7d22d7d6ccc85a5e67aa6d9

Author: Vasilii Kolobkov on 01/14/2019

Committer: Vasilii Kolobkov on 01/14/2019

Add link to css stylesheet

... and switch to using printf in header for i'm less likely to forget
escaping output that way.

Stats

git3html | 15 +++++---
1 file changed, 10 insertions(+), 5 deletions(-)

Patch

diff --git a/git3html b/git3html
index 4e63b4b..fd38d0c 100755
--- a/git3html
+++ b/git3html
@@ -98,20 +98,25 @@ header() (
 	<html>
 	<head>
 	END
-	echo "<title>$(echo "$title" | escape)</title>"
+	printf '<title>%s</title>\n' "$(echo "$title" | escape)"
+	printf '<link rel="stylesheet" type="text/css" href="%s">\n' \
+		"$(echo "${toroot%/}/style.css" | escape)"
 	cat <<-END
 	</head>
 	<body>
 	<header>
 	END
-	echo "<h1>$(echo "$projname" | escape)</h1>"
+	printf '<h1>%s</h1>\n' "$(echo "$projname" | escape)"
 	cat <<-END
 	<nav>
 	<ul>
 	END
-	echo "<li><a href=\"${toroot%/}/readme.html\">Readme</a></li>"
-	echo "<li><a href=\"${toroot%/}/log.html\">Log</a></li>"
-	echo "<li><a href=\"${toroot%/}/files.html\">Files</a></li>"
+	printf '<li><a href="%s">Readme</a></li>\n' \
+		"$(echo "${toroot%/}/readme.html" | escape)"
+	printf '<li><a href="%s">Log</a></li>\n' \
+		"$(echo "${toroot%/}/log.html" | escape)"
+	printf '<li><a href="%s">Files</a></li>\n' \
+		"$(echo "${toroot%/}/files.html" | escape)"
 	cat <<-END
 	</ul>
 	</nav>