diff --git a/blocks/_blog-post-featured-image.liquid b/blocks/_blog-post-featured-image.liquid index f4fc47cf2..c09231270 100644 --- a/blocks/_blog-post-featured-image.liquid +++ b/blocks/_blog-post-featured-image.liquid @@ -7,39 +7,41 @@ assign image = closest.article.image %} -
- {%- capture image_border_style -%} - {% render 'border-override', settings: block_settings %} - {%- endcapture -%} +{% if image != blank %} +
+ {%- capture image_border_style -%} + {% render 'border-override', settings: block_settings %} + {%- endcapture -%} - {{ - image - | image_url: width: 3840 - | image_tag: - width: image.width, - widths: '240, 352, 832, 1200, 1600, 1920, 2560, 3840', - height: image.height, - class: 'blog-post-featured-image__image border-style', - style: image_border_style, - sizes: 'auto, (min-width: 750px) 100vw, 100vw', - loading: 'eager', - fetchpriority: 'high', - alt: image.alt - }} -
+ {{ + image + | image_url: width: 3840 + | image_tag: + width: image.width, + widths: '240, 352, 832, 1200, 1600, 1920, 2560, 3840', + height: image.height, + class: 'blog-post-featured-image__image border-style', + style: image_border_style, + sizes: 'auto, (min-width: 750px) 100vw, 100vw', + loading: 'eager', + fetchpriority: 'high', + alt: image.alt + }} +
+{% endif %} {% stylesheet %} .blog-post-featured-image { diff --git a/sections/main-blog-post.liquid b/sections/main-blog-post.liquid index e77758e07..6deb378e1 100644 --- a/sections/main-blog-post.liquid +++ b/sections/main-blog-post.liquid @@ -13,17 +13,6 @@ {% render 'spacing-style', settings: section.settings %} " > -
- {%- content_for 'block', id: 'blog-post-title', type: 'text' %} - {%- content_for 'block', id: 'blog-post-details', type: '_blog-post-info-text' %} -
- - {%- if article.image -%} - {%- content_for 'block', id: 'blog-post-image', type: '_blog-post-featured-image' %} - {%- endif -%} - {%- content_for 'block', id: 'blog-post-content', type: '_blog-post-content' %} - - {% comment %} Dynamic area for @app blocks only, at the bottom {% endcomment %} {% content_for 'blocks' %} {% if blog.comments_enabled? %} @@ -119,6 +108,15 @@ }, { "type": "@app" + }, + { + "type": "_blog-post-info-text" + }, + { + "type": "_blog-post-featured-image" + }, + { + "type": "_blog-post-content" } ], "class": "section-wrapper", diff --git a/templates/article.json b/templates/article.json index 587f3e2df..1f2eb5d8d 100644 --- a/templates/article.json +++ b/templates/article.json @@ -15,7 +15,6 @@ "blog-post-title": { "type": "text", "name": "Title", - "static": true, "settings": { "text": "

{{ article.title }}

", "width": "100%", @@ -42,7 +41,6 @@ "blog-post-details": { "type": "_blog-post-info-text", "name": "Details", - "static": true, "settings": { "show_date": true, "show_author": false, @@ -57,7 +55,6 @@ "blog-post-image": { "type": "_blog-post-featured-image", "name": "Featured image", - "static": true, "settings": { "image_ratio": "landscape", "width": "fill", @@ -78,11 +75,16 @@ }, "blog-post-content": { "type": "_blog-post-content", - "static": true, "settings": {}, "blocks": {} } }, + "block_order": [ + "blog-post-title", + "blog-post-details", + "blog-post-image", + "blog-post-content" + ], "settings": { "content_direction": "column", "gap": 32,