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