diff options
author | Bradley Taunt <bt@btxx.org> | 2024-01-20 12:22:51 -0500 |
---|---|---|
committer | Bradley Taunt <bt@btxx.org> | 2024-01-20 12:22:51 -0500 |
commit | 1ffa37fb134c0de58959a4078e89249ae1a2ca75 (patch) | |
tree | b42cfbbc17a10c78db5dc30ec7f207904a58812f | |
parent | 6f2813354606e0beb2db4da236fdea77750e1cb9 (diff) |
More custom work, visual layout changes
-rw-r--r-- | ssgit.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -78,8 +78,12 @@ int html_encode(FILE *f, const char *s) { } } +void repo_image(FILE *f, const char *repo_name) { + fprintf(f, "<hr><img style='height:auto;margin:1em auto;max-width:100%%;' src='https://git.btxx.org/screenshots/%s.png'/>", repo_name); +} + void intro(FILE *f, const char *repo_name, const char *desc) { - fprintf(f, "<td><div><b>%s</b> - %s</div><div><code>git clone %s/%s.git</code></div></td></tr></tbody></table><hr>\n", repo_name, desc, DOMAIN, repo_name); + fprintf(f, "<td><div><b>%s</b><br> %s</div><div><code>git clone %s/%s.git</code></div></td></tr></tbody></table><div><code>%s@patches.btxx.org</code></div><hr>\n", repo_name, desc, DOMAIN, repo_name, repo_name); } void print_file(FILE *f, git_blob* blob, bool lines_number) { @@ -127,8 +131,6 @@ int process_file(const git_tree_entry *file, const char *root, const char *name, } void root_readme(FILE* f, const git_tree* tree) { - fprintf(f, - "<hr><div style='text-align:center;'><img src='img.png'/></div>\n"); const git_tree_entry* readme = git_tree_entry_byname(tree, "README"); if (readme != NULL) { git_blob* blob = NULL; @@ -196,6 +198,7 @@ int process_tree(const git_tree* tree, const char* tree_path, const struct Confi } } + repo_image(f, conf->repo_name); if (is_root) { root_readme(f, tree); } |