commit 57dec2db41bccc7da60272db51cf418518b326c7
parent b15151a9c0df099e289b0ca1228c269128a40c3e
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Sat, 8 Jun 2024 18:07:24 +0200
fix: remove second menu from summary
Diffstat:
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/bin/git_update_repo_html.sh b/bin/git_update_repo_html.sh
@@ -38,6 +38,7 @@ if [ -f "${1}/bin/activity.sh" ]; then
ACTIVITY_HTML=`${1}/bin/activity.sh "${1}/${2}/${3}.git"`
fi
+# Summary Page -----------------------------------------------------------------
# create summary index page
if [ -f "${1}/${2}/${3}/index.html" ]; then
@@ -53,29 +54,15 @@ sed -i "${1}/${2}/${3}/index.html" \
## fetch repo description, URL and README
RDESC=$(cat "${1}/${2}/${3}.git/description_full" 2>/dev/null)
RURL=$(cat "${1}/${2}/${3}.git/url" 2>/dev/null)
-RDME=$(
- find "${1}/${2}/${3}/file" \
- -type f \
- -name "README*.html" \
- -exec basename {} \;
-)
## generate summary injection content
SUMR="
${ACTIVITY_HTML}
- <p>${RDESC}</p>
+ <p id=\"description\">${RDESC}</p>
<hr>
<span>Clone this repository via:</span><br>
- <a href='javascript:navigator.clipboard.writeText(\"git clone $RURL\");alert(\"git clone $RURL copied to your clipboard\")';>
- git clone $RURL
+ <pre>git clone <a href=\"$RURL\">$RURL</a></pre>
</a>
- <ul>
- <li><a href=\"log.html\">Log</a></li>
- <li><a href=\"files.html\">Files</a></li>
- <li><a href=\"exports/\">Exports</a></li>
- <li><a href=\"refs.html\">Refs</a></li>
- <li><a href=\"file/${RDME:-..}\">README</a></li>
- </ul>
</div>
</body>
</html>
@@ -84,6 +71,8 @@ SUMR="
## Inject Summary into content
echo "$SUMR" >> "${1}/${2}/${3}/index.html"
+# Replacements -----------------------------------------------------------------
+
# Protect Mail-Adresses in HTML
MAILEXP='s/([a-zA-Z0-9\.]+)\@([a-zA-Z0-9\-]+)\.([a-z]+)/\1\[AT\]\2\[DOT\]\3/g'
find "${1}/${2}/${3}/" -type f -exec sed -E -e ${MAILEXP} -i {} \;
@@ -97,10 +86,10 @@ INJEXP="s/^(<a\ href=\"\.{0,2}\/*log.html\">)/<a\ href=\"\/${2}\/${3}\/index.htm
find "${1}/${2}/${3}/" -type f -name "*.html" -exec sed -E "${INJEXP}" -i {} \;
# Replace "git clone" href
-INJEXP="s/(git\ clone)\ <a href=\"(https:\/\/.*?\.git)\">/<a href='javascript:navigator.clipboard.writeText(\"\1 \2\");alert(\"\1 \2 copied to your clipboard\")';>\1 /"
+INJEXP="s/(git\ clone)\ <a href=\"(https:\/\/.*?\.git)\">/<a href='javascript:navigator.clipboard.writeText(\"\1 \2\");alert(\"\1 \2 copied to your clipboard\")';>\1 /g"
find "${1}/${2}/${3}/" -type f -name "*.html" -exec sed -E "${INJEXP}" -i {} \;
-# link assets
+# Linking Assets ---------------------------------------------------------------
ln -sf "${1}/assets/style.css" "${1}/${2}/${3}/style.css"
ln -sf "${1}/assets/favicon.png" "${1}/${2}/${3}/favicon.png"
ln -sf "${1}/assets/backicon.png" "${1}/${2}/${3}/logo.png"