diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-30 17:47:21 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-30 17:47:21 +0530 |
commit | 48016ebbe55051ea4745c57cbc937d2a66c22ef9 (patch) | |
tree | 21f32d36bfd2ca6aa7c40a46baeae38a18dcdbeb | |
parent | 7cc0394cd4ccdbab3ff6fabea0efdd20a3117fc2 (diff) |
templates: move base.html into subdirectory
-rw-r--r-- | compromyse.xyz/templates/base.html (renamed from compromyse.xyz/base.html) | 0 | ||||
-rw-r--r-- | include/msg.h | 3 | ||||
-rw-r--r-- | src/msg.c | 1 | ||||
-rw-r--r-- | src/template.c | 4 |
4 files changed, 5 insertions, 3 deletions
diff --git a/compromyse.xyz/base.html b/compromyse.xyz/templates/base.html index 042ee4d..042ee4d 100644 --- a/compromyse.xyz/base.html +++ b/compromyse.xyz/templates/base.html diff --git a/include/msg.h b/include/msg.h index 7320520..f15d9c9 100644 --- a/include/msg.h +++ b/include/msg.h @@ -20,8 +20,9 @@ #define __MSG_H #define PARTIALS "partials" -#define CONFIG_FILE "config.cfg" +#define TEMPLATES "templates" #define BASE_TEMPLATE "base.html" +#define CONFIG_FILE "config.cfg" typedef struct { char *base_directory; @@ -152,6 +152,7 @@ run(void) struct stat path_stat; stat(path, &path_stat); + /* TODO: Error handling */ if (S_ISREG(path_stat.st_mode)) copy_recursively(path, NULL, FTW_F, NULL); else if (S_ISDIR(path_stat.st_mode)) diff --git a/src/template.c b/src/template.c index 960ebc6..73b21e4 100644 --- a/src/template.c +++ b/src/template.c @@ -22,8 +22,8 @@ #include <engine.h> #include <filehandler.h> #include <lexer.h> -#include <msg.h> #include <mkdio.h> +#include <msg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -37,7 +37,7 @@ template_create(void) template_t *template = malloc(sizeof(template_t)); char *path; - asprintf(&path, "%s/%s", msg->base_directory, BASE_TEMPLATE); + asprintf(&path, "%s/%s/%s", msg->base_directory, TEMPLATES, BASE_TEMPLATE); FILE *base = fopen(path, "r"); free(path); |