cld-ssg

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

commit d96859b9cc68d4ee1da9c64a089c06ea64a0b6c6
parent ec12284a1c531188bb24c38a7edbe42b1d95ff7d
Author: Christopher Ray Langford <chris@hellocld.com>
Date:   Thu, 12 Sep 2019 15:36:30 -0400

Can load a file, convert the markdown to html, and print it

It's even loading from a struct I write to. Has some memory leaks though

Diffstat:
Mmain.c | 11+++++++++--
Mtestdir/201909042150-boop.md | 8+++++++-
2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/main.c b/main.c @@ -57,8 +57,14 @@ int main() strcat(file, "./testdir/"); strcat(file, (*files)->d_name); printf("%s\n", file); - char *read = read_text(file, MAX_POST_CHARS); - printf("%s\n%s", file, read); + struct post *tp = create_post(file); + printf("%s\n%s", file, tp->content); + free(tp->content); + free(tp); + free(testdir); + while(filecount-- > 0) + free(*files++); + free(files); return 0; } @@ -119,6 +125,7 @@ char *read_text(const char *path, int maxLength) char *t = o; while((c = fgetc(f)) != EOF && --maxLength > 0) *(t++) = (char)c; + *t = '\0'; fclose(f); return o; } diff --git a/testdir/201909042150-boop.md b/testdir/201909042150-boop.md @@ -1 +1,7 @@ -I'm a test file! :) +# A Test +I'm a test file! :) Look at `some code`, see something *important*. + +It's all here! +- Pretty cool, right? +- Yes, very cool. +- [Links are **cooler**](https://hellocld.com)