Repo containing scripts to be used with dovel, and git hooks that powers our web interface.
Author: brian (git@myr.sh)
Date: Wed Sep 20 13:35:26 2023 -0300
Parent: d1c88be
Changed script to function
diff --git a/create-file-page b/create-file-page
deleted file mode 100755
index 920d135..0000000
--- a/create-file-page
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-# for debugging
-# set -ex
-cat << EOF
-<!DOCTYPE html>
-<html>
-<head>
- <title>$REPO's git</title>
- <meta charset="UTF-8">
- <meta name="author" content="Brian Lee Mayer">
- <meta name="description" content="This is the development homepage of the Dovel project, this is the repo $REPO. Find here code, all mailing lists and latest development changes.">
- <meta name="language" content="english">
- <meta name="keywords" content="email, dovel, blmayer, self host, software, smtp, web, interface">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="color-scheme" content="light dark">
- <style>
- body {
- max-width: 600px;
- margin: 60px auto;
- padding: 20px;
- font-family: sans-serif;
- }
- table {width: 100%}
- th {text-align: left}
- pre {
- white-space: pre-line;
- font-family: monospace;
- background: lightgray;
- padding: 8px;
- border-radius: 8px;
- }
- ol li {padding-bottom: 10px}
- tt {font-weight: bold}
- @media (prefers-color-scheme: dark) {
- pre {background: darkslategray}
- }
- </style>
-</head>
-<body>
- <center>
- <h1>$REPO</h1>
- <nav>
- <a href=index.html>index</a>  
- <a href=refs.html>refs</a>  
- <a href=log.html>log</a>  
- <a href=/$REPO/tree.html>tree</a>  
- <a href=mail.html>mail</a>
- </nav>
- <p><i>$(cat description)</i></p>
- </center>
- <hr>
- <h2>$1</h2>
- <pre>
- <ol>
-EOF
- while read -r l
- do
- echo "<li>$l</li>"
- done < "$OUT/tree/$1"
-
- echo "</ol>\n</pre>\n</body>\n</html>"
diff --git a/update-repo-tree b/update-repo-tree
index 7dcc866..cb1111b 100755
--- a/update-repo-tree
+++ b/update-repo-tree
@@ -6,6 +6,67 @@ echo "updating git tree"
OUT="$HOME/www/dovel.email/$REPO"
+createfilepage() {
+ cat <<- EOF
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>$REPO's git</title>
+ <meta charset="UTF-8">
+ <meta name="author" content="Brian Lee Mayer">
+ <meta name="description" content="This is the development homepage of the Dovel project, this is the repo $REPO. Find here code, all mailing lists and latest development changes.">
+ <meta name="language" content="english">
+ <meta name="keywords" content="email, dovel, blmayer, self host, software, smtp, web, interface">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="color-scheme" content="light dark">
+ <style>
+ body {
+ max-width: 600px;
+ margin: 60px auto;
+ padding: 20px;
+ font-family: sans-serif;
+ }
+ table {width: 100%}
+ th {text-align: left}
+ pre {
+ white-space: pre-line;
+ font-family: monospace;
+ background: lightgray;
+ padding: 8px;
+ border-radius: 8px;
+ }
+ ol li {padding-bottom: 10px}
+ tt {font-weight: bold}
+ @media (prefers-color-scheme: dark) {
+ pre {background: darkslategray}
+ }
+ </style>
+ </head>
+ <body>
+ <center>
+ <h1>$REPO</h1>
+ <nav>
+ <a href=index.html>index</a>  
+ <a href=refs.html>refs</a>  
+ <a href=log.html>log</a>  
+ <a href=/$REPO/tree.html>tree</a>  
+ <a href=mail.html>mail</a>
+ </nav>
+ <p><i>$(cat description)</i></p>
+ </center>
+ <hr>
+ <h2>$1</h2>
+ <pre>
+ <ol>
+ EOF
+ while read -r l
+ do
+ echo "<li>$l</li>"
+ done < "$OUT/tree/$1"
+
+ echo "</ol>\n</pre>\n</body>\n</html>"
+}
+
echo "creating tree.html"
cat << EOF > "$OUT/tree.html"
<!DOCTYPE html>
@@ -62,7 +123,7 @@ EOF
(cd "$OUT/tree" && find * -type f -printf '%s %p\n') | while read -r s f
do
- echo "updating file $1"
+ echo "updating file $f"
cat <<- EOF >> "$OUT/tree.html"
<tr>
@@ -71,5 +132,5 @@ do
<td><a href=tree/$f>raw</a></td>
</tr>
EOF
- ./hooks/create-file-page "$f" > "$OUT/tree/$f.html"
+ createfilepage "$f" > "$OUT/tree/$f.html"
done