From f0800f0c2c138da2ca16f75f00ebed3435f96e15 Mon Sep 17 00:00:00 2001 From: radhitya Date: Tue, 21 Jan 2025 23:12:38 +0700 Subject: [PATCH] hmm --- main.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 7ecb908..7b4a19a 100644 --- a/main.c +++ b/main.c @@ -108,19 +108,24 @@ void get_posts(const char *path, Post *posts, int *count) { void generate_pagination(Post *posts, int total_posts, int posts_per_page) { header = doinsert("./media/header.html"); - footer = doinsert("./media/footer.html"); - int total_pages = (total_posts + posts_per_page - 1) / posts_per_page; + int total_pages = (total_posts + posts_per_page - 1) / posts_per_page; FILE *archive = fopen("./target/archive.html", "w"); if (archive == NULL) { perror("Galat archive.html"); return; } + printf("%s", header); fprintf(archive, "\n\n\n"); fprintf(archive, "Archive - %s", SUBTITLE); fprintf(archive, "\n\n"); + if (header != NULL) { + fprintf(archive, "%s", header); + } else { + fprintf(stderr, "ga bisa buat header wqwqwq"); + } + fprintf(archive, ""); - fprintf(archive,"

Archive