Skip to content

Commit d348349

Browse files
authored
Added support for hidden title and feature image on pages (#943)
* Added support for hidden title and feature image on pages Refs https://github.com/TryGhost/Product/issues/3568 * Switched from match to if helper for show_title_and_feature_image Refs https://github.com/TryGhost/Product/issues/3568
1 parent 4ae190c commit d348349

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

page.hbs

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,32 @@ into the {body} tag of the default.hbs template --}}
1010
<main id="site-main" class="site-main">
1111
<article class="article {{post_class}}">
1212

13-
<header class="article-header gh-canvas">
14-
15-
<h1 class="article-title">{{title}}</h1>
16-
17-
{{#if feature_image}}
18-
<figure class="article-image">
19-
{{!-- This is a responsive image, it loads different sizes depending on device
20-
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
21-
<img
22-
srcset="{{img_url feature_image size="s"}} 300w,
23-
{{img_url feature_image size="m"}} 600w,
24-
{{img_url feature_image size="l"}} 1000w,
25-
{{img_url feature_image size="xl"}} 2000w"
26-
sizes="(min-width: 1400px) 1400px, 92vw"
27-
src="{{img_url feature_image size="xl"}}"
28-
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
29-
/>
30-
{{#if feature_image_caption}}
31-
<figcaption>{{feature_image_caption}}</figcaption>
32-
{{/if}}
33-
</figure>
34-
{{/if}}
35-
36-
</header>
13+
{{#if show_title_and_feature_image}}
14+
<header class="article-header gh-canvas">
15+
16+
<h1 class="article-title">{{title}}</h1>
17+
18+
{{#if feature_image}}
19+
<figure class="article-image">
20+
{{!-- This is a responsive image, it loads different sizes depending on device
21+
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
22+
<img
23+
srcset="{{img_url feature_image size="s"}} 300w,
24+
{{img_url feature_image size="m"}} 600w,
25+
{{img_url feature_image size="l"}} 1000w,
26+
{{img_url feature_image size="xl"}} 2000w"
27+
sizes="(min-width: 1400px) 1400px, 92vw"
28+
src="{{img_url feature_image size="xl"}}"
29+
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
30+
/>
31+
{{#if feature_image_caption}}
32+
<figcaption>{{feature_image_caption}}</figcaption>
33+
{{/if}}
34+
</figure>
35+
{{/if}}
36+
37+
</header>
38+
{{/if}}
3739

3840
<section class="gh-content gh-canvas">
3941
{{content}}

0 commit comments

Comments
 (0)