ssnail

crappy and opinionated static site generator
git clone https://git.e1e0.net/ssnail.git
Log | Files | Refs | README | LICENSE

commit cc6ae0914d118d981fa811c91a3ffbd6f3bc732f
parent d42fe37ed17a238e006cff6967105da64dd36b13
Author: Paco Esteban <paco@e1e0.net>
Date:   Wed,  1 Jul 2020 16:37:28 +0200

index title can taken now from the command line (like rss)

Diffstat:
Mssnail.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ssnail.c b/ssnail.c @@ -62,7 +62,7 @@ static void add_rss_entry(char **, struct article *, char *); struct article *init_article(void); static struct article *populate_article_entry(char *, char *); -static struct article *generate_index(char *, char *); +static struct article *generate_index(char *, char *, char *); static const struct ssnail_error *process_dir(char *, char *, int); static const struct ssnail_error *write_html(struct article *, char *, char *); @@ -181,7 +181,7 @@ main(int argc, char *argv[]) if (index || force) { printf("Generate index ... \n"); - ip = generate_index(argv[1], index_listing); + ip = generate_index(argv[1], index_listing, title); if (ip == NULL) { error = ssnail_error_msg(2, "index"); goto done; @@ -523,7 +523,7 @@ sort_articleq(struct listhead *h) } static struct article * -generate_index(char *dst_path, char *index_listing) { +generate_index(char *dst_path, char *index_listing, char *title) { assert(index_listing != NULL); struct article *a = init_article(); @@ -543,7 +543,7 @@ generate_index(char *dst_path, char *index_listing) { if (strftime(a->date, SHORT_DATE_Z, "%Y-%m-%d", timeinfo) == 0) goto error; - if ((a->title = strdup("index")) == NULL) + if ((a->title = strdup(title)) == NULL) goto error; if ((a->type = strdup("index")) == NULL) goto error;