-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathvideo-message.hugo.html
More file actions
136 lines (125 loc) · 4.28 KB
/
video-message.hugo.html
File metadata and controls
136 lines (125 loc) · 4.28 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{{/*
Copyright © 2025 The Hinode Team / Mark Dumay. All rights reserved.
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
Visit gethinode.com/license for more details.
*/}}
{{/* Initialize arguments */}}
{{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "video-message" "args" .) }}
{{ if or $args.err $args.warnmsg }}
{{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict
"partial" "component-library/components/video-message/video-message.hugo.html"
"warnid" "warn-invalid-arguments"
"msg" "Invalid arguments"
"details" ($args.errmsg | append $args.warnmsg)
"file" page.File
)}}
{{ end }}
{{- $breakpoint := partial "utilities/GetBreakpoint.html" -}}
{{- define "_partials/inline/video.html" -}}
{{ $provider := .provider }}
{{ $account := .account }}
{{ $mediaID := (index . "media-id") }}
{{ $autoplay := .autoplay }}
{{ $queryArgs := .queryArgs }}
{{ $border := .border }}
{{ if site.Params.env_bookshop_live }}
{{/* Define dummy content as we cannot retrieve video data in live mode */}}
{{- partial "assets/live-image.html" (dict "src" "/img/placeholder-video.svg" "ratio" "21x9" "wrapper" "text-center mb-4") -}}
{{ else }}
<div class="video-container{{ if $border }} video-container-border{{ end}}">
{{ partial "assets/video.html" (dict
"page" page
"provider" $provider
"account" $account
"media-id" $mediaID
"autoplay" $autoplay
"query-args" $queryArgs
) -}}
{{ if $border }}
<div class="video-overlay video-overlay-start"></div>
<div class="video-overlay video-overlay-top"></div>
<div class="video-overlay video-overlay-end"></div>
<div class="video-overlay video-overlay-bottom"></div>
{{ end }}
</div>
{{ end }}
{{ end }}
{{- define "_partials/inline/messages.html" -}}
{{ $list := .list }}
{{ $cols := .cols }}
{{ $type := .type }}
{{ $iconRounded := .iconRounded }}
{{- partial "assets/card-group.html" (dict
"page" page
"list" $list
"class" "border-0 card-icon card-icon-secondary"
"cols" $cols
"gutter" ""
"padding" "0"
"header-style" "none"
"footer-style" "none"
"icon-style" "fa-fluid fa-fw"
"align" "start"
"orientation" "horizontal-sm"
"button" true
"link-type" $type
"icon-rounded" $iconRounded
) -}}
{{ end }}
<div class="container-xxl p-4 px-xxl-0">
{{ $list := slice }}
{{ range $args.messages }}
{{ $path := "" }}
{{ $href := "" }}
{{ with .link }}{{ if hasPrefix . "http" }}{{ $href = . }}{{ else }}{{ $path = . }}{{ end }}{{ end }}
{{ $list = $list | append (dict
"title" .title
"description" (.content | page.RenderString)
"icon" .icon
"href" $href
"path" $path
"button-label" .label
) }}
{{ end}}
{{- partial "assets/section-title.html" (dict
"heading" $args.heading
"class" "py-5"
) -}}
{{ if eq $args.orientation "stacked" }}
<div class="col-{{ $breakpoint.current }}-{{ $args.width }} mx-auto">
{{ with $args.video }}
{{- partial "inline/video.html" (dict
"provider" .provider
"account" .account
"media-id" (index . "media-id")
"autoplay" .autoplay
"query-args" .queryArgs
"border" $.border
) -}}
{{ end }}
</div>
<div class="mt-4">
{{- partial "inline/messages.html" (dict "list" $list "cols" $args.cols "type" $args.type "iconRounded" $args.iconRounded) -}}
</div>
{{ else }}
<div class="container grid gap-4">
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2">
<div class="col col-{{ $breakpoint.current }}-{{ $args.width }} p-0">
{{ with $args.video }}
{{- partial "inline/video.html" (dict
"provider" .provider
"account" .account
"media-id" (index . "media-id")
"autoplay" .autoplay
"query-args" .queryArgs
"border" $.border
) -}}
{{ end }}
</div>
<div class="col col-{{ $breakpoint.current }}-{{ sub 12 $args.width }} mt-4 mt-{{ $breakpoint.current }}-0">
{{- partial "inline/messages.html" (dict "list" $list "cols" 1 "type" $args.type "iconRounded" $args.iconRounded) -}}
</div>
</div>
</div>
{{ end }}
</div>