Printables

{%- assign onboard = false -%} {%- if section.settings.blog == blank and section.settings.title == blank -%} {%- assign onboard = true -%} {%- endif -%}
{%- unless onboard -%} {%- if section.settings.title != blank -%}

{{ section.settings.title }}

{%- endif -%} {%- else -%}

{{ 'onboarding.home_blog.title' | t }}

{%- endunless -%}
{%- unless onboard -%} {%- for article in blogs[section.settings.blog].articles limit: section.settings.posts -%} {%- assign publishedAt = article.published_at | time_tag: '%b %d, %Y' -%} {%- assign title = article.title -%} {%- capture image -%} {%- if article.image -%} {{ article.title }} {%- endif -%} {%- endcapture -%} {%- assign excerpt = article.excerpt -%} {%- assign url = article.url -%} {%- if excerpt == blank -%} {%- assign excerpt = article.content | strip_html | truncatewords: 65 -%} {%- endif -%} {%- include 'home-blog-post' -%} {%- endfor -%} {%- else -%} {%- for i in (1..3) -%} {%- assign publishedAt = 'now' | time_tag: '%b %d, %Y' -%} {%- assign title = 'onboarding.home_blog.post_title' | t -%} {%- assign image = 'image' | placeholder_svg_tag -%} {%- assign excerpt = 'onboarding.home_blog.post_excerpt' | t -%} {%- include 'home-blog-post' -%} {%- endfor -%} {%- endunless -%}
{% schema %} { "name": "Blog posts", "settings": [ { "type": "text", "id": "title", "label": "Heading" }, { "type": "blog", "id": "blog", "label": "Blog" }, { "type": "select", "id": "posts", "label": "Posts to display", "default": "3", "options": [ { "value": "2", "label": "2" }, { "value": "3", "label": "3" }, { "value": "4", "label": "4" } , { "value": "8", "label": "8" } ] }, { "type": "select", "id": "columns", "default": "3", "options": [ { "value": "1", "label": "1" }, { "value": "2", "label": "2" }, { "value": "3", "label": "3" }, { "value": "4", "label": "4" } ], "label": "Columns" } ], "presets": [ { "category": "Blog", "name": "Blog posts" } ] } {% endschema %}