ctucx.git: stagit

ctucx' stagit fork

commit f417217875dd79d2ba8eae618e93255976a92e01
parent a35b505e666f797735eb143f3aa70c7c9222e9c1
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date: Thu, 6 Jan 2022 19:28:30 +0100

Add contribute link to homepage contribute section
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/stagit-index.c b/stagit-index.c
@@ -111,7 +111,7 @@ writefooter(FILE *fp)
 		"<h2 id=\"contribute\">Contribute</h2>\n"
 		"<p>The best way to contribute to my repositories is through e-mail, check out <a href=\"https://git-send-email.io\">git-send-email.io</a> if you don’t know how to do that. Send your patches to <a href=\"mailto:patches@oscarbenedito.com\">patches@oscarbenedito.com</a> and change the subject prefix to specify the repository you are sending the patch for. You can do that running the following command from the git repository:</p>\n"
 		"<pre><code>git config format.subjectPrefix \"PATCH &lt;name-of-repository&gt;\"</code></pre>\n"
-		"<p>You can also contribute on <a href=\"https://github.com/oscarbenedito\">GitHub</a> doing pull requests (all my public repositories are mirrored there, as well as <a href=\"https://git.sr.ht/~ob\">Sourcehut</a>).</p>\n"
+		"<p>You can also contribute on <a href=\"https://github.com/oscarbenedito\">GitHub</a> doing pull requests (all my public repositories are mirrored there, as well as <a href=\"https://git.sr.ht/~ob\">SourceHut</a>).</p>\n"
 		"</div>\n</body>\n</html>\n", fp);
 }
 
diff --git a/stagit.c b/stagit.c
@@ -556,6 +556,8 @@ writeheader(FILE *fp, const char *title)
 	if (contribute)
 		fprintf(fp, " | <a href=\"%sfile/%s.html\">Contribute</a>",
 		        relpath, contribute);
+	else
+		fprintf(fp, " | <a href=\"../%s#contribute\">Contribute</a>", relpath);
 	fputs("</p>\n</div>\n<hr/>\n<div id=\"content\">\n", fp);
 }