aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-07-30 17:47:21 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-07-30 17:47:21 +0530
commit48016ebbe55051ea4745c57cbc937d2a66c22ef9 (patch)
tree21f32d36bfd2ca6aa7c40a46baeae38a18dcdbeb
parent7cc0394cd4ccdbab3ff6fabea0efdd20a3117fc2 (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.h3
-rw-r--r--src/msg.c1
-rw-r--r--src/template.c4
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;
diff --git a/src/msg.c b/src/msg.c
index 4f69e43..3f3499b 100644
--- a/src/msg.c
+++ b/src/msg.c
@@ -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);