From 1a49b24f8ea40bdd8d035c4b412b7609e9241405 Mon Sep 17 00:00:00 2001 From: Tobias Johansson Date: Tue, 23 Oct 2018 15:09:02 +0200 Subject: [PATCH] Blog Bug fix: Unable to render blog before first post --- src/templates/nodes/custom/blog/_macros.pug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/nodes/custom/blog/_macros.pug b/src/templates/nodes/custom/blog/_macros.pug index 65a3568..9728025 100644 --- a/src/templates/nodes/custom/blog/_macros.pug +++ b/src/templates/nodes/custom/blog/_macros.pug @@ -73,14 +73,14 @@ a.card.asset.card-image-fade.pr-0.mx-0.mb-4( //- ******************************************************* -// | {% macro render_blog_index(current_post, project, posts, can_create_blog_posts, api, more_posts_available, posts_meta, pages=None) %} -| {% if can_create_blog_posts or current_post.has_method('PUT') %} +| {% if can_create_blog_posts or (current_post and current_post.has_method('PUT')) %} +nav-secondary | {% if can_create_blog_posts %} +nav-secondary-link(href="{{url_for('nodes.posts_create', project_id=project._id)}}") i.pi-plus.pr-2 span Create New Blog Post | {% endif %} - | {% if current_post.has_method('PUT') %} + | {% if (current_post and current_post.has_method('PUT')) %} +nav-secondary-link(href="{{url_for('nodes.edit', node_id=current_post._id)}}") i.pi-edit.pr-2 span Edit Post