aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc/renderer.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2020-05-16 03:33:22 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2020-05-16 03:33:22 +0200
commit8e12ae57ebe87d25c2c34ec304047fec3013da85 (patch)
treefc7f974219f6d60d8e866a540da45f69e696546b /src/blogc/renderer.c
parentf5db671822b7b6dc74166c1c9e34a900c7f0d0cb (diff)
downloadblogc-8e12ae57ebe87d25c2c34ec304047fec3013da85.tar.gz
blogc-8e12ae57ebe87d25c2c34ec304047fec3013da85.tar.bz2
blogc-8e12ae57ebe87d25c2c34ec304047fec3013da85.zip
blogc: added listing_empty template block
Diffstat (limited to 'src/blogc/renderer.c')
-rw-r--r--src/blogc/renderer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/blogc/renderer.c b/src/blogc/renderer.c
index 140a86e..8f576e0 100644
--- a/src/blogc/renderer.c
+++ b/src/blogc/renderer.c
@@ -242,6 +242,7 @@ blogc_render(bc_slist_t *tmpl, bc_slist_t *sources, bc_slist_t *listing_entries,
tmp_source = listing_entry;
}
else if ((0 == strcmp("listing", node->data[0])) ||
+ (0 == strcmp("listing_empty", node->data[0])) ||
(0 == strcmp("listing_once", node->data[0]))) {
if (!listing) {
@@ -254,6 +255,18 @@ blogc_render(bc_slist_t *tmpl, bc_slist_t *sources, bc_slist_t *listing_entries,
break;
}
}
+ if (0 == strcmp("listing_empty", node->data[0])) {
+ if (sources != NULL) {
+
+ // we can just skip anything and walk until the next
+ // 'endblock'
+ while (node->type != BLOGC_TEMPLATE_NODE_ENDBLOCK) {
+ tmp = tmp->next;
+ node = tmp->data;
+ }
+ break;
+ }
+ }
if (0 == strcmp("listing", node->data[0])) {
if (sources == NULL) {