diff options
author | lukasepple <git@lukasepple.de> | 2014-08-08 10:45:49 +0200 |
---|---|---|
committer | lukasepple <git@lukasepple.de> | 2014-08-08 10:45:49 +0200 |
commit | 66ee3afdcd2136dd04265ccbecb7d231e0246f5d (patch) | |
tree | b05beb00620253b03253d27bf2867072d30e44d2 /templates | |
parent | 75b262b0aa4377eda1bc8df49653eb1aaf127b90 (diff) |
moved the templating stuff to struct blogpost
Diffstat (limited to 'templates')
-rw-r--r-- | templates/simple.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/templates/simple.c b/templates/simple.c index f286ed0..6754bc1 100644 --- a/templates/simple.c +++ b/templates/simple.c @@ -19,8 +19,8 @@ void template_footer(void) { printf("</body></html>"); } -void template_post_single_entry(char post_path[]) { - FILE *fp = fopen(post_path, "r"); +void template_post_single_entry(struct blogpost post) { + FILE *fp = fopen(post.path, "r"); char c; printf("<article>\n"); @@ -34,8 +34,8 @@ void template_post_single_entry(char post_path[]) { fclose(fp); } -void template_post_index_entry(char post_path[], char link_path[]) { - FILE *fp = fopen(post_path, "r"); +void template_post_index_entry(struct blogpost post) { + FILE *fp = fopen(post.path, "r"); char c; printf("<article>\n"); @@ -44,7 +44,7 @@ void template_post_index_entry(char post_path[], char link_path[]) { printf("%c", c); } - printf("<p><a href=\"%s\">Permalink</a></p></article>\n", link_path); + printf("<p><a href=\"%s\">Permalink</a></p></article>\n", post.link); fclose(fp); } |