forked from TryGhost/Solo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.hbs
73 lines (67 loc) · 3.52 KB
/
index.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{{!< default}}
<section class="gh-about gh-outer{{#match @custom.header_section_layout "!=" "Typographic profile"}}{{#unless @site.cover_image}} no-image{{/unless}}{{else}}{{#unless @site.icon}} no-image{{/unless}}{{/match}}">
<div class="gh-about-inner gh-inner">
{{#match @custom.header_section_layout "!=" "Typographic profile"}}
{{#match @custom.header_section_layout "=" "Large background"}}
{{#if @site.cover_image}}
<img class="gh-about-image"
srcset="{{img_url @site.cover_image size="s"}} 300w,
{{img_url @site.cover_image size="m"}} 720w,
{{img_url @site.cover_image size="l"}} 960w,
{{img_url @site.cover_image size="xl"}} 1200w,
{{img_url @site.cover_image size="xxl"}} 2000w"
sizes="100vw"
src="{{@site.cover_image}}" alt="{{@site.title}}">
{{/if}}
{{else}}
{{#if @site.cover_image}}
<img class="gh-about-image"
srcset="{{img_url @site.cover_image size="s"}} 300w,
{{img_url @site.cover_image size="m"}} 720w"
sizes="(max-width: 720px) 100vw, 50vw"
src="{{@site.cover_image}}" alt="{{@site.title}}">
{{/if}}
{{/match}}
{{else}}
{{#if @site.icon}}
<img class="gh-about-image" src="{{@site.icon}}" alt="{{@site.title}}">
{{/if}}
{{/match}}
<script>
(function () {
if (!document.body.classList.contains('has-background-about')) return;
const about = document.querySelector('.gh-about');
if (!about) return;
const image = about.querySelector('.gh-about-image');
about.style.setProperty('--about-height', image.clientWidth * image.naturalHeight / image.naturalWidth + 'px');
about.classList.add('initialized');
})();
</script>
<div class="gh-about-content">
<div class="gh-about-content-inner">
{{#if @custom.primary_header}}
<h1 class="gh-about-primary">{{{@custom.primary_header}}}</h1>
{{/if}}
{{#if @custom.secondary_header}}
<p class="gh-about-secondary">{{{@custom.secondary_header}}}</p>
{{/if}}
{{#if @site.members_enabled}}
{{#unless @member}}
<div class="gh-subscribe-input" data-portal>
<span class="gh-btn gh-primary-btn">Subscribe</span>
</div>
{{/unless}}
{{/if}}
</div>
</div>
</div>
</section>
<main class="gh-main gh-outer">
<div class="gh-feed gh-inner">
{{#foreach posts}}
{{> "loop"}}
{{/foreach}}
</div>
</main>
{{#contentFor "body_class"}}{{#match @custom.header_section_layout "Side by side"}} has-side-about{{/match}}{{#match @custom.header_section_layout "Large background"}}{{#if @site.cover_image}} is-head-transparent has-background-about{{else}} has-side-about{{/if}}{{/match}}{{#match @custom.header_section_layout "Typographic profile"}}{{#if @site.icon}} has-typographic-about{{else}} has-side-about{{/if}}{{/match}}{{/contentFor}}