ctucx.git: stagit

ctucx' stagit fork

commit 28207c037682d6da9536a5895db1dc2d621a19df
parent abad2b6e02ae04cd6cae1bff5365981bd9bfe8dd
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 23 May 2022 18:49:41 +0200

readme: also detect 'readme.md' as readme and render it's content to html
1 file changed, 2 insertions(+), 2 deletions(-)
M
stagit.c
|
4
++--
diff --git a/stagit.c b/stagit.c
@@ -71,7 +71,7 @@ static char cloneurl[1024];
 static char *submodules;
 static char *licensefiles[] = { "HEAD:LICENSE", "HEAD:LICENSE.md", "HEAD:COPYING" };
 static char *license;
-static char *readmefiles[] = { "HEAD:README", "HEAD:README.md" };
+static char *readmefiles[] = { "HEAD:README", "HEAD:README.md", "HEAD:readme.md" };
 static char *readme;
 static char *contributefiles[] = { "HEAD:CONTRIBUTING", "HEAD:CONTRIBUTING.md" };
 static char *contribute;

@@ -1356,7 +1356,7 @@ main(int argc, char *argv[])
 		writeheader(fp, "About");
 		git_revparse_single(&obj, repo, readmefiles[r]);
 		const char *s = git_blob_rawcontent((git_blob *)obj);
-		if (r == 1) {
+		if (r == 1 | r == 2) {
 			git_off_t len = git_blob_rawsize((git_blob *)obj);
 			fputs("<div class=\"md\">", fp);
 			if (md_html(s, len, process_output_md, fp, MD_FLAG_TABLES | MD_FLAG_TASKLISTS |