aboutsummaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-11-28 04:37:59 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-11-28 04:37:59 +0300
commit7b0eaa806f2cfc84e4c26f8f608e1d4e4843ea05 (patch)
treefd7ca9abad667e43c75aa09580dd145448ff72a5 /src/render.c
parente2a71b0366aa80a7cf131fdbde6012671493d364 (diff)
downloadrevela-7b0eaa806f2cfc84e4c26f8f608e1d4e4843ea05.tar.gz
revela-7b0eaa806f2cfc84e4c26f8f608e1d4e4843ea05.zip
Clean out old files/dirs
Delete extraneous files/images/albums that are no longer present in the source directory.
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/render.c b/src/render.c
index acd1de2..79fb543 100644
--- a/src/render.c
+++ b/src/render.c
@@ -84,11 +84,9 @@ years_destroy(struct vector *years)
vector_free(years);
}
-static bool
-albums_walk(struct bstnode *node, void *data)
+bool
+render_set_album_vars(struct render *r, struct album *album)
{
- struct album *album = node->value;
- struct render *r = data;
hashmap_insert(album->map, "title", album->config->title);
hashmap_insert(album->map, "desc", album->config->desc);
@@ -213,7 +211,7 @@ render_init(struct render *r, const char *root, struct site_config *conf,
r->years = vector_new(8);
r->albums = vector_new(64);
- r->common_vars = hashmap_new_with_cap(8);
+ r->common_vars = hashmap_new_with_cap(16);
hashmap_insert(r->common_vars, "title", conf->title);
if (strlen(conf->base_url) == 0) {
hashmap_insert(r->common_vars, "index", "/");
@@ -221,7 +219,7 @@ render_init(struct render *r, const char *root, struct site_config *conf,
hashmap_insert(r->common_vars, "index", conf->base_url);
}
- bstree_inorder_walk(albums->root, albums_walk, (void *)r);
+ //bstree_inorder_walk(albums->root, albums_walk, (void *)r);
cleanup:
free(tmplpath);