From feb64d3270076adabb5c15b03e0fcf87601686b8 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Mon, 2 Mar 2026 21:51:27 +0900 Subject: [PATCH] thing --- src/classic.c | 37 ++++++++++++++++++++++++++++++++++++- src/seed.c | 22 +++++++++++++++------- src/site.c | 17 +++++++++++++++++ src/taiga.h | 1 + src/util.c | 8 ++++++++ 5 files changed, 77 insertions(+), 8 deletions(-) diff --git a/src/classic.c b/src/classic.c index bce1a73..730e18c 100644 --- a/src/classic.c +++ b/src/classic.c @@ -12,12 +12,12 @@ void classic_stylesheet(FILE* out, const char* top) { char path[128]; char* breadcrumb_bgcolor = NULL; xl_node_t** nodes; + int i; char* messages[] = { "fixme", "#cc6600", /**/ "warning", "#990000", /**/ "note", "#006699" /**/ }; - int i; sprintf(path, "%sfill.gif", top); f = fopen(path, "wb"); @@ -157,6 +157,11 @@ void classic_body(FILE* out, const char* top, const char* title, xl_node_t* body char* sitesearch = NULL; xl_node_t** nodes; xl_node_t* child; + int i; + char* images[] = { + "group", "Group", /**/ + "project", "Project" /**/ + }; strcpy(year, "Some year"); @@ -191,6 +196,36 @@ void classic_body(FILE* out, const char* top, const char* title, xl_node_t* body } if(sitesearch == NULL) sitesearch = "https://invalid.link"; + fprintf(out, " \n"); + fprintf(out, " \n"); + fprintf(out, " \n"); + fprintf(out, " \n"); + fprintf(out, "
\n"); + for(i = 0; i < sizeof(images) / sizeof(images[0]); i++) { + char path[64]; + char* description = ""; + + sprintf(path, "%s.name", images[i]); + if((nodes = xl_get_path(skinconf->root, path)) != NULL) { + description = nodes[i]->text; + free(nodes); + } + if(description == NULL) description = "Logo"; + + sprintf(path, "%s.image", images[i]); + if((nodes = xl_get_path(skinconf->root, path)) != NULL) { + char* text = xl_get_attribute(nodes[0], "src"); + + if(text != NULL) { + text = u_path(top, text); + fprintf(out, " \"%s\"\n", text, images[i + 1], description); + free(text); + } + + free(nodes); + } + } + fprintf(out, "
\n"); fprintf(out, " \n"); fprintf(out, " \n"); fprintf(out, "
\n"); diff --git a/src/seed.c b/src/seed.c index 6258d55..7a0a3e1 100644 --- a/src/seed.c +++ b/src/seed.c @@ -8,7 +8,7 @@ static void describe(const char* path, const char* what) { int i; memset(space, 0, sizeof(space)); - for(i = 0; i < (32 - strlen(path)); i++) space[i] = ' '; + for(i = 0; i < (48 - strlen(path)); i++) space[i] = ' '; printf("%s%s# %s\n", path, space, what); } @@ -18,17 +18,17 @@ int action_seed(int argc, char** argv) { io_mkdir("site", 0755); io_mkdir("site/content", 0755); - io_mkdir("site/image", 0755); + io_mkdir("site/content/image", 0755); - if((f = fopen("site/image/group-logo.png", "w")) == NULL) { - fprintf(stderr, "Failed to open site/image/group-logo.png\n"); + if((f = fopen("site/content/image/group-logo.png", "w")) == NULL) { + fprintf(stderr, "Failed to open site/content/image/group-logo.png\n"); return 1; } fwrite(image_logo1, image_logo1_len, 1, f); fclose(f); - if((f = fopen("site/image/project-logo.png", "w")) == NULL) { - fprintf(stderr, "Failed to open site/image/project-logo.png\n"); + if((f = fopen("site/content/image/project-logo.png", "w")) == NULL) { + fprintf(stderr, "Failed to open site/content/image/project-logo.png\n"); return 1; } fwrite(image_logo2, image_logo2_len, 1, f); @@ -45,11 +45,17 @@ int action_seed(int argc, char** argv) { fprintf(f, " \n"); fprintf(f, " \n"); fprintf(f, " \n"); + fprintf(f, " \n"); + fprintf(f, " Example Co, Ltd\n"); + fprintf(f, " Example Co, Ltd Description\n"); + fprintf(f, " \n"); + fprintf(f, " \n"); + fprintf(f, " \n"); fprintf(f, " \n"); fprintf(f, " Example Project\n"); fprintf(f, " Example Project Description\n"); fprintf(f, " \n"); - fprintf(f, " \n"); + fprintf(f, " \n"); fprintf(f, " \n"); fprintf(f, "