cld-ssg

The static site generator (to be) used for hellocld.com
git clone git://git.hellocld.com/cld-ssg
Log | Files | Refs

commit cf1fbb492c43f97a9e1439ef4b7bd815513c8830
parent 2669e12ff3fb871250824b0c9e35d816fd1bb6ec
Author: Christopher Ray Langford <chris@hellocld.com>
Date:   Mon, 30 Sep 2019 20:36:55 -0400

Archive listings are now datestamped

Diffstat:
Mmain.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c @@ -241,11 +241,14 @@ int write_archive(struct post *posts[], int totalPosts) FILE *f = fopen(buf, "w"); fprintf(f, header); fprintf(f, "<ul>\n"); - while(totalPosts-- > 0) - fprintf(f, "<li><a href=\"%s%s\">%s</a></li>\n", + while(totalPosts-- > 0) { + strftime(buf, MAX_URL_CHARS, "%Y-%m-%d", posts[totalPosts]->time); + fprintf(f, "<li><a href=\"%s%s\">%s - %s</a></li>\n", posts[totalPosts]->dir, posts[totalPosts]->fhtml, + buf, posts[totalPosts]->title); + } fprintf(f, "</ul>\n"); fprintf(f, footer); fclose(f);