Skip to content

Commit 2bf85bc

Browse files
authored
Merge pull request #385 from amrutadotorg/patch-9
adding poster parameter to the hero component
2 parents 1b35c85 + 15539d9 commit 2bf85bc

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

examples/official-site/sqlpage/migrations/02_hero_component.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ FROM (
6666
TRUE,
6767
TRUE
6868
),
69+
(
70+
'poster',
71+
'URL of the image to be displayed before the video starts.',
72+
'URL',
73+
TRUE,
74+
TRUE
75+
),
6976
-- item level
7077
(
7178
'title',

sqlpage/templates/hero.handlebars

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="fs-1 mx-5 text-muted">
55
{{~description~}}
66
{{~#if description_md~}}
7-
{{{markdown description_md}}}
7+
{{{markdown description_md}}}
88
{{~/if~}}
99
</div>
1010
{{#if link}}
@@ -15,7 +15,12 @@
1515
<img src="{{image}}" alt="{{title}}" class="hero-image img-fluid col-lg-6" />
1616
{{/if}}
1717
{{#if video}}
18-
<video src="{{video}}" alt="{{title}}" class="hero-image img-fluid col-lg-6" controls />
18+
<video src="{{video}}" alt="{{title}}" class="hero-image img-fluid col-lg-6" controls
19+
{{#if poster}}
20+
preload="none"
21+
poster="{{poster}}"
22+
{{/if}}>
23+
</video>
1924
{{/if}}
2025
</header>
2126

@@ -28,7 +33,7 @@
2833
<div class="card-body text-center p-4 p-lg-5 pt-0 pt-lg-0">
2934
{{#if icon}}
3035
<div style="margin-top: -1.5rem;" class="badge bg-{{default color 'success'}} text-{{default color 'success'}}-fg fs-1 mb-4 p-2">
31-
{{~icon_img icon 30~}}
36+
{{~icon_img icon 30~}}
3237
</div>
3338
{{/if}}
3439
<h2>
@@ -39,11 +44,11 @@
3944
{{#if link}}
4045
</a>
4146
{{/if}}
42-
</h2>
47+
</h2>
4348
<div class="mb-0">
4449
{{~description~}}
4550
{{~#if description_md~}}
46-
{{{markdown description_md}}}
51+
{{{markdown description_md}}}
4752
{{~/if~}}
4853
</div>
4954
</div>

0 commit comments

Comments
 (0)