From: Stefan Sperling Subject: gotwebd tree + readme on summary page To: gameoftrees@openbsd.org Date: Fri, 8 Dec 2023 10:17:41 +0100 Trying to show README files on the summary page, this is the best I could come up with. It basically copies the code used by the tree view. Displaying just the README is possible by stubbing out the tree item display callback (lazy approach, I know; a better approach would use a custom function to hunt for the README file). But turns out displaying the HEAD tree on the summary page as well looks quite nice, so let's just do that? ok? ----------------------------------------------- show tree and README at the bottom of the summary page diff 89f6914cfb2489a403b5b126d58861ae83956d6d 63a2a9a0691d9348a8ec1b753bee34b543d2dcca commit - 89f6914cfb2489a403b5b126d58861ae83956d6d commit + 63a2a9a0691d9348a8ec1b753bee34b543d2dcca blob - 6f10d4cdf8eb1b86650aa5bce14f797b3dd37759 blob + b4fc0da3456e925fd8adc8f5751157df4c7d31bd --- gotwebd/pages.tmpl +++ gotwebd/pages.tmpl @@ -1084,10 +1084,16 @@ nextsep(char *s, char **t) {{ define gotweb_render_summary(struct template *tp) }} {! + const struct got_error *error; struct request *c = tp->tp_arg; struct server *srv = c->srv; struct transport *t = c->t; struct got_reflist_head *refs = &t->refs; + struct gotweb_url url; + char *readme = NULL; + int binary; + const uint8_t *buf; + size_t len; !}