stagit

static git repository generator

git clone https://9o.is/git/stagit.git

commit d3406e8b9f91bdb6ea544378fab30f28c159da61
parent 12ee3b92969e320583df71b60e0f90cdb37a887f
Author: Jul <jul@9o.is>
Date:   Tue, 12 May 2026 20:56:08 +0800

replace index page table with ordered list

Diffstat:
Mstagit-index.c | 32+++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/stagit-index.c b/stagit-index.c @@ -12,7 +12,7 @@ static git_repository *repo; static const char *relpath = ""; -static char description[255] = "Repositories"; +static char description[255] = "Git Repositories"; static char *name = ""; static char owner[255]; @@ -117,20 +117,17 @@ writeheader(FILE *fp) fputs("Blog</a></li>\n", fp); fputs("<li><a href=\"/git\">Git</a></li>\n", fp); fputs("</ul></div></nav>\n", fp); - fputs("<main class=\"git\">\n", fp); - fputs("<header class=\"main\"><h1>\n", fp); + fputs("<main class=\"git-repos\">\n", fp); + fputs("<header class=\"main\">\n<h1>", fp); xmlencode(fp, description, strlen(description)); - fputs("</h1></header>\n" - "<table id=\"index\"><thead>\n" - "<tr><td><b>Name</b></td><td><b>Description</b></td>" - "<td><b>Last commit</b></td></tr>" - "</thead><tbody>\n", fp); + fputs("</h1>\n<p>Browse and clone my public git projects</p>\n", fp); + fputs("</header>\n<ol>\n", fp); } void writefooter(FILE *fp) { - fputs("</tbody>\n</table>\n</main>\n</body>\n</html>\n", fp); + fputs("</ol>\n</main>\n</body>\n</html>\n", fp); } int @@ -161,16 +158,21 @@ writelog(FILE *fp) if (!strcmp(p, ".git")) *p = '\0'; - fputs("<tr><td><a href=\"", fp); + fputs("<li><article>\n", fp); + fputs("<h2><a href=\"", fp); percentencode(fp, stripped_name, strlen(stripped_name)); fputs("/log.html\">", fp); xmlencode(fp, stripped_name, strlen(stripped_name)); - fputs("</a></td><td>", fp); - xmlencode(fp, description, strlen(description)); - fputs("</td><td>", fp); - if (author) + fputs("</a></h2>\n", fp); + if (author) { + fputs("<time>", fp); printtimeshort(fp, &(author->when)); - fputs("</td></tr>", fp); + fputs("</time>\n", fp); + } + fputs("<p>", fp); + xmlencode(fp, description, strlen(description)); + fputs("</p>\n", fp); + fputs("</article></li>\n", fp); git_commit_free(commit); err: