stagit

- static git page generator
git clone git://git.acid.vegas/stagit.git
Log | Files | Refs | Archive | README | LICENSE

commit 61bf72aca45739ee1437aecd8be75be3d4cd5f89
parent f8939eb30300ce26ef3869cf8ed698300e353e37
Author: acidvegas <acid.vegas@acid.vegas>
Date: Fri, 16 Jun 2023 21:07:29 -0400

Added a contacts/mirrors header on the home page

Diffstat:
Massets/helper | 3++-
Mstagit-index.c | 8++++++--
Mstagit.c | 6++----

3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/assets/helper b/assets/helper
@@ -21,6 +21,7 @@ find_repos() {
 prepair() {
 	[ -d $HTML_DIR ] && rm -rf $HTML_DIR/*
 	mkdir -p $HTML_DIR/assets
+	echo "[~] populating custom assets..."
 	cp acidvegas.png favicon.png logo.png mostdangerous.png style.css $HTML_DIR/assets
 	echo $URL > $HTML_DIR/CNAME
 }
@@ -59,7 +60,7 @@ make_repos() {
 		echo "[~] processing '$REPO' repository..."
 		mkdir -p $HTML_DIR/$REPO && cd $HTML_DIR/$REPO && stagit -l $COMMIT_LIMIT -u "$PROTO://$URL/$REPO" $dir
 		ln -sf log.html index.html
-		#git --git-dir $dir/.git archive --format=tar.gz -o "$HTML_DIR/$REPO/$REPO.tar.gz" --prefix="$REPO/" HEAD
+		git --git-dir $dir/.git archive --format=tar.gz -o "$HTML_DIR/$REPO/$REPO.tar.gz" --prefix="$REPO/" HEAD
 	done
 }
 
diff --git a/stagit-index.c b/stagit-index.c
@@ -80,8 +80,12 @@ void writeheader(FILE *fp) {
 		"<meta name=\"author\" content=\"acidvegas\">\n", fp);
 	fputs("<link rel=\"icon\" type=\"image/png\" href=\"/assets/favicon.png\">\n"
 		"<link rel=\"stylesheet\" type=\"text/css\" href=\"/assets/style.css\">\n", fp);
-	fputs("<center>\n<img src=\"/assets/acidvegas.png\"><br>\n<img src=\"/assets/mostdangerous.png\"><br><br>\n"
-		"<div id=\"content\">\n\t<table id=\"index\">\n\t\t<thead>\n\t\t\t<tr><td>Name</td><td>Description</td><td>Last commit</td></tr>\n\t\t</thead>\n\t\t<tbody>", fp);
+	fputs("<center>\n<img src=\"/assets/acidvegas.png\"><br>\n<img src=\"/assets/mostdangerous.png\"><br><br>\n", fp);
+	fputs("<div class=\"container\">\n\t<center>\n\t<table>\n\t\t<tr><td>\n"
+		"<b>contact</b> : <a href=\"https://discord.gg/BCqRZZR\">discord</a> &bull; <a href=\"ircs://irc.supernets.org/superbowl\">irc</a> &bull; <a href=\"mailto://acid.vegas@acid.vegas\">mail</a> &bull; <a href=\"https://twitter.com/acidvegas\">twitter</a>\n"
+		"<br><b>mirrors</b> : <a href=\"https://github.com/acidvegas\">github</a> &bull; <a href=\"https://gitlab.com/acidvegas\">gitlab</a> &bull; <a href=\"https://sr.hr/~acidvegas\">sourcehut</a> &bull; <a href=\"https://git.supernets.org/acidvegas\">supernets</a>\n"
+        "\t\t</td></tr>\n\t</table>\n\t</center>\n</div>\n<br>\n", fp);
+	fputs("<div id=\"content\">\n\t<table id=\"index\">\n\t\t<thead>\n\t\t\t<tr><td>Name</td><td>Description</td><td>Last commit</td></tr>\n\t\t</thead>\n\t\t<tbody>", fp);
 }
 
 void writefooter(FILE *fp) {
diff --git a/stagit.c b/stagit.c
@@ -495,14 +495,12 @@ void writeheader(FILE *fp, const char *title) {
 	fprintf(fp, "<a href=\"%sfiles.html\">Files</a> | ", relpath);
 	fprintf(fp, "<a href=\"%srefs.html\">Refs</a>", relpath);
 	if (submodules)
-		fprintf(fp, " | <a href=\"%sfile/%s.html\">Submodules</a>",
-		        relpath, submodules);
+		fprintf(fp, " | <a href=\"%sfile/%s.html\">Submodules</a>", relpath, submodules);
 	if (readme)
 		//fprintf(fp, " | <a href=\"%sfile/%s.html\">README</a>", relpath, readme);
 		fprintf(fp, " | <a href=\"%sREADME.html\">README</a>", relpath);
 	if (license)
-		fprintf(fp, " | <a href=\"%sfile/%s.html\">LICENSE</a>",
-		        relpath, license);
+		fprintf(fp, " | <a href=\"%sfile/%s.html\">LICENSE</a>", relpath, license);
 	fputs("</td></tr>\n\t</table>\n</div>\n<br>\n", fp);
 }