Post image style setting

This commit is contained in:
Sodbileg Gansukh 2022-05-19 21:46:26 +08:00
parent 5fc101fb2c
commit c74be0e346
2 changed files with 6 additions and 3 deletions

View file

@ -144,12 +144,13 @@
], ],
"default": "Light" "default": "Light"
}, },
"post_image_width": { "post_image_style": {
"type": "select", "type": "select",
"options": [ "options": [
"Wide", "Wide",
"Full", "Full",
"Small" "Small",
"Hidden"
], ],
"default": "Wide", "default": "Wide",
"group": "post" "group": "post"

View file

@ -8,7 +8,7 @@ into the {body} tag of the default.hbs template --}}
{{!-- Everything inside the #post block pulls data from the post --}} {{!-- Everything inside the #post block pulls data from the post --}}
<main id="site-main" class="site-main"> <main id="site-main" class="site-main">
<article class="article {{post_class}} {{#match @custom.post_image_width "Full"}}image-full{{else match @custom.post_image_width "=" "Small"}}image-small{{/match}}"> <article class="article {{post_class}} {{#match @custom.post_image_style "Full"}}image-full{{else match @custom.post_image_style "=" "Small"}}image-small{{/match}}">
<header class="article-header gh-canvas"> <header class="article-header gh-canvas">
@ -52,6 +52,7 @@ into the {body} tag of the default.hbs template --}}
</section> </section>
</div> </div>
{{#match @custom.post_image_style "!=" "Hidden"}}
{{#if feature_image}} {{#if feature_image}}
<figure class="article-image"> <figure class="article-image">
{{!-- This is a responsive image, it loads different sizes depending on device {{!-- This is a responsive image, it loads different sizes depending on device
@ -70,6 +71,7 @@ into the {body} tag of the default.hbs template --}}
{{/if}} {{/if}}
</figure> </figure>
{{/if}} {{/if}}
{{/match}}
</header> </header>