From 1daa8ac7599756ae159eb75140e738bbae8a9e09 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Mon, 2 Mar 2026 22:03:39 +0900 Subject: [PATCH] have link --- src/classic.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/classic.c b/src/classic.c index 730e18c..89fe402 100644 --- a/src/classic.c +++ b/src/classic.c @@ -201,14 +201,22 @@ void classic_body(FILE* out, const char* top, const char* title, xl_node_t* body fprintf(out, " \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, " \"%s\"\n", text, images[i + 1], description); + fprintf(out, " \"%s\"\n", link, text, images[i + 1], name); free(text); }