ssnail

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

commit 65aef9349943b10659a9d182d46f68f8aeae1353
parent 2db36a53521a53aceeb671878d5bd93dabe571c1
Author: Paco Esteban <paco@e1e0.net>
Date:   Thu,  2 Jul 2020 16:02:41 +0200

move default type, if not it gets overriden

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

diff --git a/ssnail.c b/ssnail.c @@ -284,6 +284,12 @@ gen_html(struct article *a) lowdown_buf(&opts, a->orig_content, strlen(a->orig_content), &a->html_content, &a->htmlz, &mq); + /* setup default type if not set */ + if ((a->type = strdup("page")) == NULL) { + error = ssnail_error_from_errno("def type"); + goto out; + } + /* collect metadata from markdown */ TAILQ_FOREACH(md, &mq, entries) { if (strcmp(md->key, "title") == 0 ) { @@ -312,12 +318,6 @@ gen_html(struct article *a) } } - /* setup default type if not set */ - if ((a->type = strdup("page")) == NULL) { - error = ssnail_error_from_errno("def type"); - goto out; - } - out: lowdown_metaq_free(&mq);