Skip to content

Commit 35780e5

Browse files
authored
Merge pull request #48258 from sftim/20241008_redo_kubeweekly
Refactor KubeWeekly signup form
2 parents 855ef2e + ab48449 commit 35780e5

File tree

5 files changed

+65
-10
lines changed

5 files changed

+65
-10
lines changed

assets/scss/_custom.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,33 @@ body.td-home main[role="main"] > section:first-of-type .content p:first-child {
125125
}
126126
}
127127

128+
.section-feature#kubeweekly {
129+
130+
a.kubeweekly-signup, a.kubeweekly-signup:hover {
131+
color: $primary;
132+
font-weight: 400;
133+
font-size: 1.1rem;
134+
}
135+
> .kubeweekly-inner {
136+
form p {
137+
text-align: center;
138+
font-size: 1.2rem;
139+
color: $black;
140+
}
141+
margin-left: auto;
142+
margin-right: auto;
143+
padding-top: 2rem;
144+
}
145+
146+
h5 {
147+
text-align: center;
148+
149+
a:hover {
150+
text-decoration: underline;
151+
}
152+
}
153+
}
154+
128155
body.td-404 main .error-details {
129156
max-width: 1100px;
130157
margin: 0 auto;

content/en/_index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@ <h3>Attend upcoming KubeCon + CloudNativeCon events</h3>
6262
{{< blocks/kubernetes-features >}}
6363

6464
{{< blocks/case-studies >}}
65+
66+
{{< kubeweekly id="kubeweekly" >}}

layouts/index.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,20 @@
88
</div>
99
</section>
1010

11+
{{/* legacy kubeweekly support */}}
12+
{{/* allows localizations to catch up */}}
13+
{{- if not (.HasShortcode "kubeweekly") -}}
1114
<section id="kubeweekly">
1215
<div class="main-section">
1316
<!-- Begin MailChimp Signup Form -->
1417
<link href="https://cdn-images.mailchimp.com/embedcode/horizontal-slim-10_7.css" rel="stylesheet" type="text/css">
15-
<style type="text/css">
16-
#mc_embed_signup{clear:left; width:100%;}
17-
#mc_embed_signup .button, #mc_embed_signup input.email {margin-right:15px; vertical-align: bottom}
18-
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
19-
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
20-
</style>
21-
<br>
18+
<br>
2219
<div id="mc_embed_signup">
2320
<form action="https://kubeweekly.us10.list-manage.com/subscribe/post?u=3885586f8f1175194017967d6&amp;id=11c1b8bcb2" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
2421
<div id="mc_embed_signup_scroll">
25-
<p style="font-size: 20px">{{ T "main_kubeweekly_baseline" }}</p>
22+
<p style="font-size: 20px">{{ T "main_kubeweekly_baseline" }}</p>
2623

27-
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="{{ T "input_placeholder_email_address" }}" aria-label="email" required>
24+
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="{{ T "input_placeholder_email_address" }}" aria-label="email" required>
2825
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
2926
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_3885586f8f1175194017967d6_11c1b8bcb2" tabindex="-1" value=""></div>
3027
<div class="clear"><input type="submit" value="{{ T "subscribe_button" }}" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
@@ -36,7 +33,8 @@ <h5 style="text-align: center"><a href="https://us10.campaign-archive.com/home/?
3633
<!--End mc_embed_signup-->
3734
</div>
3835
</section>
39-
{{ end }}
36+
{{- end -}}
37+
{{- end -}}
4038

4139

4240
{{ define "hero-more" }}

layouts/partials/hooks/head-end.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737

3838
<link rel="manifest" href="/manifest.webmanifest">
3939

40+
{{- if .HasShortcode "kubeweekly" -}}
41+
<link href="https://cdn-images.mailchimp.com/embedcode/horizontal-slim-10_7.css" rel="stylesheet" type="text/css">
42+
<style type="text/css">
43+
#mc_embed_signup{clear:left; width:100%;}
44+
#mc_embed_signup .button, #mc_embed_signup input.email {margin-right:15px; vertical-align: bottom}
45+
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
46+
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
47+
</style>
48+
{{- end -}}
49+
4050
{{- if or (.HasShortcode "table") (.HasShortcode "feature-gate-table") -}}
4151
{{- if hugo.IsProduction -}}
4252
{{- $sortableTableJs := resources.Get "js/sortable-table.js" | minify | fingerprint -}}

layouts/shortcodes/kubeweekly.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- $id := .Get "id" | default (printf "kubeweekly-%d" .Ordinal) -}}
2+
<section class="section-feature" id="{{ $id }}">
3+
<div class="kubeweekly-inner">
4+
<div id="mc_embed_signup">
5+
<form action="https://kubeweekly.us10.list-manage.com/subscribe/post?u=3885586f8f1175194017967d6&amp;id=11c1b8bcb2" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
6+
<div id="mc_embed_signup_scroll">
7+
<p>{{ T "main_kubeweekly_baseline" }}</p>
8+
9+
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="{{ T "input_placeholder_email_address" }}" aria-label="email" required>
10+
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
11+
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_3885586f8f1175194017967d6_11c1b8bcb2" tabindex="-1" value=""></div>
12+
<div class="clear"><input type="submit" value="{{ T "subscribe_button" }}" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
13+
</div>
14+
</form>
15+
<h5><a class="kubeweekly-signup" href="https://us10.campaign-archive.com/home/?u=3885586f8f1175194017967d6&id=11c1b8bcb2" aria-label="Kube Weekly">{{ T "main_kubeweekly_past_link" }}</a></h5>
16+
</div>
17+
</div>
18+
</section>

0 commit comments

Comments
 (0)