{% macro link_to(text, endpoint) -%} {{ text }} {%- endmacro %} {% macro render_grid_item(content) %}

{{ content.title }}

{% with main_image=content.get_main_image_url(thumb=True, default=None) %} {% if main_image %} {% endif %} {% endwith %}

{{content.summary|truncate(255)|safe()}}

Published at {{ content.created_at.strftime('%H:%M of %m/%d/%Y') }}

Read more »

{% endmacro %} {% macro render_grid(contents) %} {% for content in contents %} {{render_grid_item(content)}} {% endfor %} {% endmacro %} {% macro render_list_item(content) %}

{{ content.title }}

{% with main_image=content.get_main_image_url(thumb=True, default=None) %} {% if main_image %} {% endif %} {% endwith %}

{{content.summary|truncate(255)|safe()}}

Published at {{ content.created_at.strftime('%H:%M of %m/%d/%Y') }}

Read more »

{% endmacro %} {% macro render_list(contents) %} {% for content in contents %} {{render_list_item(content)}} {% endfor %} {% endmacro %} {# --- Content areas ----- #} {% macro load_share_area(content) %} Social share loaded here {% endmacro %} {% macro render_recommend_item(content) %}

{{ content.title }}

{% with main_image=content.get_main_image_url(thumb=True, default=None) %} {% if main_image %} {% endif %} {% endwith %}

{{content.summary|truncate(140)|safe()}}

Published at {{ content.created_at.strftime('%H:%M of %m/%d/%Y') }}

Read more »

{% endmacro %} {% macro load_recommendation_area(content) %} {% with %} {% set recommendations=content.get_recommendations()%} {% if recommendations %}
{% for item in recommendations %} {{render_recommend_item(item)}} {% endfor %}
{% endif %} {% endwith %} {% endmacro %} {% macro load_tags_area(content) %}
{% for tag in content.tags %} {{tag}} {% endfor %}
{% endmacro %} {% macro load_comment_area(content) %}
Loading comment system...
You have to set yout disqus preferences {% endmacro %} {% macro load_page_header(content) %} {% endmacro %} {% macro load_page_time(content) %} {{ content.created_by.name }} at {{ content.created_at.strftime('%H:%M of %m/%d/%Y') }} {% endmacro %} {% macro load_page_content(content, truncate=None) %}

{% with main_image=content.get_main_image_url(thumb=False, default=None) %} {% if main_image %} {% endif %} {% endwith %} {% if not truncate %} {% if content.body %} {{ content.body|safe() }} {% elif content.description %} {{ content.description|safe() }} {% else %} {{ content.summary|safe() }} {% endif %} {% else %} {% if content.body %} {{ content.body|truncate(truncate)|safe() }} {% elif content.description %} {{ content.description|truncate(truncate)|safe() }} {% else %} {{ content.summary|truncate(truncate)|safe() }} {% endif %} {% endif %}

{% endmacro %} {# blog list#} {%macro render_blog_item(content) %} {{load_page_header(content)}}
{{load_page_time(content)}}
{{load_page_content(content, truncate=2000)}} read more {{load_tags_area(content)}}
{% endmacro %} {% macro render_blog(contents) %} {% for content in contents %} {{render_blog_item(content)}}
{% endfor %} {% endmacro %} {# --------- pagination ----------- #} {% macro render_pagination(pagination, endpoint) %} {% if pagination.pages > 1 %} {% endif %} {% endmacro %}