## Macro to render a post # macro render_blog_post(post, list_mode=False)

# if list_mode: ${post.title} # else: ${post.title} #endif

# with # set do_shorten = blog_max_size and len(post.body) > blog_max_size
${wiki_to_html(context(post.resource), do_shorten and post.body[:blog_max_size] + ' ... ' or post.body)} # if do_shorten:

(Read more)

# endif
# endwith # if show_meta is undefined or show_meta: # endif
# endmacro {# Directly execute the macro on import if 'execute_blog_macro' is set. For this not to throw errors it presumes variables to be called already exists in the data dictionary. #} # if execute_blog_macro: ${render_blog_post(post, list_mode)} # endif