Skip to content

Commit b3cdf18

Browse files
minimaluminiumErisDS
authored andcommitted
Show comments only on pages
1 parent 89adf1e commit b3cdf18

6 files changed

+57
-58
lines changed

custom-full-feature-image.hbs

+1-8
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@
4646
{{> "related-posts"}}
4747

4848
{{#post}}
49-
{{#if comments}}
50-
<div class="gh-comments gh-read-next gh-canvas">
51-
<section class="gh-pagehead">
52-
<h4 class="gh-pagehead-title">Comments ({{comment_count empty="0" singular="" plural=""}})</h3>
53-
</section>
54-
{{comments title="" count=false}}
55-
</div>
56-
{{/if}}
49+
{{> "comments"}}
5750
{{/post}}
5851
</main>
5952

custom-wide-feature-image.hbs

+2-25
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,7 @@
1616
<p class="gh-article-excerpt">{{custom_excerpt}}</p>
1717
{{/if}}
1818

19-
{{#if feature_image}}
20-
<figure class="gh-article-image">
21-
<img
22-
srcset="{{img_url feature_image size="s"}} 300w,
23-
{{img_url feature_image size="m"}} 720w,
24-
{{img_url feature_image size="l"}} 960w,
25-
{{img_url feature_image size="xl"}} 1200w,
26-
{{img_url feature_image size="xxl"}} 2000w"
27-
sizes="(max-width: 1200px) 100vw, 1200px"
28-
src="{{img_url feature_image size="xl"}}"
29-
alt="{{title}}"
30-
>
31-
{{#if feature_image_caption}}
32-
<figcaption>{{feature_image_caption}}</figcaption>
33-
{{/if}}
34-
</figure>
35-
{{/if}}
19+
{{> "feature-image"}}
3620
</header>
3721

3822
<section class="gh-content gh-canvas">
@@ -44,14 +28,7 @@
4428
{{> "related-posts"}}
4529

4630
{{#post}}
47-
{{#if comments}}
48-
<div class="gh-comments gh-read-next gh-canvas">
49-
<section class="gh-pagehead">
50-
<h4 class="gh-pagehead-title">Comments ({{comment_count empty="0" singular="" plural=""}})</h3>
51-
</section>
52-
{{comments title="" count=false}}
53-
</div>
54-
{{/if}}
31+
{{> "comments"}}
5532
{{/post}}
5633
</main>
5734

page.hbs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{!< default}}
2+
3+
{{#post}}
4+
5+
<main class="gh-main">
6+
<article class="gh-article {{post_class}}">
7+
8+
<header class="gh-article-header gh-canvas">
9+
<h1 class="gh-article-title">{{title}}</h1>
10+
11+
{{#if custom_excerpt}}
12+
<p class="gh-article-excerpt">{{custom_excerpt}}</p>
13+
{{/if}}
14+
15+
{{> "feature-image"}}
16+
</header>
17+
18+
<section class="gh-content gh-canvas">
19+
{{content}}
20+
</section>
21+
22+
</article>
23+
</main>
24+
25+
{{/post}}

partials/comments.hbs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{#is "post"}}
2+
{{#if comments}}
3+
<div class="gh-comments gh-read-next gh-canvas">
4+
<section class="gh-pagehead">
5+
<h4 class="gh-pagehead-title">Comments ({{comment_count empty="0" singular="" plural=""}})</h3>
6+
</section>
7+
{{comments title="" count=false}}
8+
</div>
9+
{{/if}}
10+
{{/is}}

partials/feature-image.hbs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{#if feature_image}}
2+
<figure class="gh-article-image">
3+
<img
4+
srcset="{{img_url feature_image size="s"}} 300w,
5+
{{img_url feature_image size="m"}} 720w,
6+
{{img_url feature_image size="l"}} 960w,
7+
{{img_url feature_image size="xl"}} 1200w,
8+
{{img_url feature_image size="xxl"}} 2000w"
9+
sizes="(max-width: 1200px) 100vw, 1200px"
10+
src="{{img_url feature_image size="xl"}}"
11+
alt="{{title}}"
12+
>
13+
{{#if feature_image_caption}}
14+
<figcaption>{{feature_image_caption}}</figcaption>
15+
{{/if}}
16+
</figure>
17+
{{/if}}

post.hbs

+2-25
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,7 @@
1717
<p class="gh-article-excerpt">{{custom_excerpt}}</p>
1818
{{/if}}
1919

20-
{{#if feature_image}}
21-
<figure class="gh-article-image">
22-
<img
23-
srcset="{{img_url feature_image size="s"}} 300w,
24-
{{img_url feature_image size="m"}} 720w,
25-
{{img_url feature_image size="l"}} 960w,
26-
{{img_url feature_image size="xl"}} 1200w,
27-
{{img_url feature_image size="xxl"}} 2000w"
28-
sizes="(max-width: 1200px) 100vw, 1200px"
29-
src="{{img_url feature_image size="xl"}}"
30-
alt="{{title}}"
31-
>
32-
{{#if feature_image_caption}}
33-
<figcaption>{{feature_image_caption}}</figcaption>
34-
{{/if}}
35-
</figure>
36-
{{/if}}
20+
{{> "feature-image"}}
3721
</header>
3822

3923
<section class="gh-content gh-canvas">
@@ -46,13 +30,6 @@
4630
{{> "related-posts"}}
4731

4832
{{#post}}
49-
{{#if comments}}
50-
<div class="gh-comments gh-read-next gh-canvas">
51-
<section class="gh-pagehead">
52-
<h4 class="gh-pagehead-title">Comments ({{comment_count empty="0" singular="" plural=""}})</h3>
53-
</section>
54-
{{comments title="" count=false}}
55-
</div>
56-
{{/if}}
33+
{{> "comments"}}
5734
{{/post}}
5835
</main>

0 commit comments

Comments
 (0)