stagit

custom fork of stagit
Index Commits Files Refs README LICENSE
commit 2926deab8f5dbf4a23196bd213f0abe0ecebd15f
parent e25192c4096871fd81cc92f68535e9c52bc5a6b6
Author: mjkloeckner <martin.cachari@gmail.com>
Date:   Sun, 25 Feb 2024 15:44:55 -0300

Change header table id name and fotoer content

Diffstat:
Mstagit-index.c | 11+++++++----
Mstagit.c | 18+++++++++++++-----
2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/stagit-index.c b/stagit-index.c
@@ -107,11 +107,11 @@ writeheader(FILE *fp)
     fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath);
     fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
     fputs("</head>\n<body>\n", fp);
-    fprintf(fp, "<table id=\"header-table\">\n<tr><td><img src=\"%slogo.png\" alt=\"\" width=\"64\" height=\"64\" /></td>\n"
-            "<td><h1 id=\"main-name\">", relpath);
+    fprintf(fp, "<table id=\"main-header-table\">\n<tr><td id=\"main-header-logo\"><img src=\"%slogo.png\" alt=\"\" width=\"64\" height=\"64\" /></td>\n"
+            "<td id=\"main-header\"><h1 id=\"main-name\">", relpath);
     xmlencode(fp, description, strlen(description));
     fputs("</h1>\n"
-        "<span class=\"main-desc\"><a href=\"https://kloeckner.com.ar/\">kloeckner.com.ar</a></span>"
+        "<span class=\"main-desc\"><a href=\"https://kloeckner.com.ar/\">https://kloeckner.com.ar</a></span>"
         "</td></tr>\n</table>\n<div id=\"content\">\n"
         "<table id=\"index\"><thead id=\"legends\">\n"
         "<tr><td id=\"name\"><b>Name</b></td><td id=\"description\"><b>Description</b></td><td id=\"owner\"><b>Owner</b></td>"
@@ -122,7 +122,10 @@ writeheader(FILE *fp)
 void
 writefooter(FILE *fp)
 {
-    fputs("</tbody>\n</table>\n</div>\n</body>\n</html>\n", fp);
+    /* fputs("</tbody>\n</table>\n</div>\n</body>\n</html>\n", fp); */
+    fputs("</tbody>\n</table>\n</div>\n</body>", fp);
+    fputs("<footer>Generated with <a href=\"https://git.kloeckner.com.ar/stagit/\">Stagit</a></footer>\n", fp);
+    fputs("</html>\n", fp);
 }
 
 int
diff --git a/stagit.c b/stagit.c
@@ -540,18 +540,19 @@ writeheader(FILE *fp, const char *title)
     xmlencode(fp, name, strlen(name));
     fprintf(fp, " Atom Feed (tags)\" href=\"%stags.xml\" />\n", relpath);
     fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
-    fputs("</head>\n<body>\n<table id=\"header-table\"><tr><td>", fp);
+    fputs("</head>\n<body>\n<table id=\"repo-header-table\"><tr><td id=\"repo-logo\">", fp);
     fprintf(fp, "<a href=\"https://git.kloeckner.com.ar\"><img src=\"%slogo.png\" alt=\"\" width=\"64\" height=\"64\" /></a>",
             relpath, relpath);
-    fputs("</td><td><h1 id=\"repo-name\">", fp);
+    fputs("</td><td id=\"repo-header\"><h1 id=\"repo-name\">", fp);
     xmlencode(fp, strippedname, strlen(strippedname));
-    fputs("</h1><span class=\"desc\">", fp);
+    fputs("</h1><span id=\"repo-desc\">", fp);
     xmlencode(fp, description, strlen(description));
     fputs("</span>", fp);
 
     fputs("</td></tr></table>", fp);
 
     fputs("<div id=\"repo-top-buttons\">\n", fp);
+    fprintf(fp, "<a <a href=\"https://git.kloeckner.com.ar\">Index</a>  ", relpath);
     fprintf(fp, "<a href=\"%slog.html\">Log</a>  ", relpath);
     fprintf(fp, "<a href=\"%sfiles.html\">Files</a>  ", relpath);
     fprintf(fp, "<a href=\"%srefs.html\">Refs</a>", relpath);
@@ -579,7 +580,10 @@ writeheader(FILE *fp, const char *title)
 void
 writefooter(FILE *fp)
 {
-    fputs("</div>\n</div>\n</body>\n</html>\n", fp);
+    /* fputs("</div>\n</div>\n</body>\n</html>\n", fp); */
+    fputs("</div>\n</div>\n</body>\n", fp);
+    fputs("<footer>Generated with <a href=\"https://git.kloeckner.com.ar/stagit/\">Stagit</a></footer>\n", fp);
+    fputs("</html>\n", fp);
 }
 
 size_t
@@ -1151,7 +1155,11 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
         percentencode(fp, parent, strlen(parent));
         fputs(".html\'\">", fp);
 
-        fputs("<td id=\"file-mode\">d---------</td><td><a class=\"dir\" href=\"../", fp);
+        fputs("<td id=\"file-mode\"><a href=\"../", fp);
+        xmlencode(fp, parent, strlen(parent));
+        fputs(".html\">d---------</a></td>", fp);
+
+        fputs("<td id=\"dir-name\"><a href=\"../", fp);
         xmlencode(fp, parent, strlen(parent));
         fputs(".html\">..</a></td>", fp);