have link
All checks were successful
pyrite-dev/taiga/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-03-02 22:03:39 +09:00
commit 1daa8ac759
Signed by: nishi
GPG key ID: 27EF69B208EB9343

View file

@ -201,14 +201,22 @@ void classic_body(FILE* out, const char* top, const char* title, xl_node_t* body
fprintf(out, " <td>\n");
for(i = 0; i < sizeof(images) / sizeof(images[0]); i++) {
char path[64];
char* description = "";
char* name;
char* link;
sprintf(path, "%s.name", images[i]);
if((nodes = xl_get_path(skinconf->root, path)) != NULL) {
description = nodes[i]->text;
name = nodes[0]->text;
free(nodes);
}
if(description == NULL) description = "Logo";
if(name == NULL) name = "Logo";
sprintf(path, "%s.link", images[i]);
if((nodes = xl_get_path(skinconf->root, path)) != NULL) {
link = xl_get_attribute(nodes[0], "href");
free(nodes);
}
if(link == NULL) link = "https://invalid.link";
sprintf(path, "%s.image", images[i]);
if((nodes = xl_get_path(skinconf->root, path)) != NULL) {
@ -216,7 +224,7 @@ void classic_body(FILE* out, const char* top, const char* title, xl_node_t* body
if(text != NULL) {
text = u_path(top, text);
fprintf(out, " <img src=\"%s\" alt=\"%s\">\n", text, images[i + 1], description);
fprintf(out, " <a href=\"%s\"><img src=\"%s\" alt=\"%s\"></a>\n", link, text, images[i + 1], name);
free(text);
}