Skip to content

Commit 38f6e4c

Browse files
committed
Use Docsy-friendly section partial
Use a partial for <section> that will work with near-vanilla Docsy.
1 parent 82f4a3a commit 38f6e4c

File tree

5 files changed

+80
-70
lines changed

5 files changed

+80
-70
lines changed

assets/scss/_base.scss

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,6 @@ $ocean-nodes-h3-margin-bottom: 30px;
315315
position: relative;
316316
overflow: hidden;
317317

318-
& > .video-text-optional {
319-
width: 30vw;
320-
padding-top: 2rem;
321-
color: white;
322-
margin-right: 70vw;
323-
}
324-
325318
h2 {
326319
font-size: 32px;
327320
line-height: 44px;
@@ -345,14 +338,7 @@ $ocean-nodes-h3-margin-bottom: 30px;
345338
margin: 5px;
346339
}
347340

348-
#desktopKCButton {
349-
display: inline;
350-
position: absolute;
351-
padding: 20px 10px 20px 10px;
352-
margin: 0;
353-
}
354-
355-
#desktopKCButton:hover, .desktopKCButton:hover{
341+
.desktopKCButton:hover{
356342
background-color: #ffffff;
357343
color: #326ce5;
358344
transition: 150ms;
@@ -365,13 +351,9 @@ $ocean-nodes-h3-margin-bottom: 30px;
365351
color: $secondary;
366352
padding: 1.5rem;
367353
margin-bottom: 1rem;
368-
369-
&:hover::before {
370-
border-color: transparent transparent transparent $dark-grey;
371-
}
372354
}
373355

374-
#desktopShowVideoButton:hover{
356+
#desktopShowVideoButton:hover {
375357
color: $primary;
376358
transition: 150ms;
377359
}
@@ -389,7 +371,7 @@ $ocean-nodes-h3-margin-bottom: 30px;
389371
position: fixed;
390372
top: 50%;
391373
left:50%;
392-
transform: translate(-50%, -50%);
374+
transform: translate(-50%, -50%);
393375
}
394376

395377
#closeButton {
@@ -428,6 +410,7 @@ $ocean-nodes-h3-margin-bottom: 30px;
428410

429411
// KubeWeekly
430412
#kubeweekly {
413+
visibility: hidden;
431414
background-color: $light-grey;
432415
padding-top: 30px;
433416
padding-bottom: 80px;

assets/scss/_custom.scss

Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,6 @@ body.td-home main[role="main"] > section:first-of-type .content p:first-child {
9696
}
9797
}
9898

99-
section#upcoming-events {
100-
color: $white;
101-
background: $secondary;
102-
text-align: center;
103-
padding-top: 4rem;
104-
padding-bottom: 2rem;
105-
h2, h3, h4, h5, h6 {
106-
font-weight: bold;
107-
}
108-
> div {
109-
margin: 1.5em;
110-
padding: 0.5em 0 0.5em 0;
111-
a, a:hover {
112-
color: $white;
113-
background: transparent;
114-
font-size: 1.5rem;
115-
text-decoration: underline;
116-
strong {
117-
color: $white;
118-
background: transparent;
119-
}
120-
}
121-
}
122-
}
123-
12499
.section-feature#kubeweekly {
125100

126101
a.kubeweekly-signup, a.kubeweekly-signup:hover {
@@ -437,8 +412,10 @@ footer {
437412
background-position: 65% center, left center;
438413
background-repeat: no-repeat, repeat;
439414
background-size: auto 100%, cover;
415+
440416
.video-text-optional {
441417
padding-left: calc(max(10vw, 5rem));
418+
padding-right: clamp(2rem, 60vw, 80vw);
442419

443420
button::before, button::after {
444421
color: $secondary;
@@ -1947,6 +1924,58 @@ body.td-search {
19471924
color: #ffffff !important;
19481925
}
19491926

1927+
body.td-home section#upcoming-events > .col > .row {
1928+
color: $white;
1929+
background: $secondary;
1930+
text-align: center;
1931+
padding-top: 2rem;
1932+
padding-bottom: 2rem;
1933+
1934+
flex-direction: row;
1935+
row-gap: 0.25rem;
1936+
column-gap: calc(clamp(1rem, 5vw, 6rem);
1937+
justify-content: center;
1938+
flex-wrap: wrap;
1939+
1940+
> h2, h3, h4, h5, h6 {
1941+
font-weight: bold;
1942+
width: 100vw;
1943+
padding: 1rem;
1944+
padding-top: 2rem;
1945+
padding-bottom: 2rem;
1946+
}
1947+
1948+
> div {
1949+
margin: 0.5em;
1950+
padding: 0.5em 0 0.5em 0;
1951+
a, a:hover {
1952+
color: $white;
1953+
background: transparent;
1954+
font-size: 1.5rem;
1955+
}
1956+
a {
1957+
text-decoration: none;
1958+
&:hover {
1959+
text-decoration: underline;
1960+
text-decoration-color: $white;
1961+
strong {
1962+
text-decoration: initial;
1963+
}
1964+
}
1965+
strong {
1966+
color: $white;
1967+
background: transparent;
1968+
text-decoration: underline;
1969+
text-decoration-color: $primary;
1970+
}
1971+
1972+
&::before {
1973+
content: '';
1974+
}
1975+
}
1976+
}
1977+
}
1978+
19501979
body.td-home section.case-studies {
19511980
h2, h3 {
19521981
text-align: center;

assets/scss/_desktop.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,6 @@ $vendor-strip-height: 44px;
6464
}
6565
}
6666

67-
#video {
68-
position: relative;
69-
background-position: top center;
70-
background-size: cover;
71-
72-
&>.light-text {
73-
margin: 0 10% 15px 0;
74-
}
75-
}
76-
77-
78-
7967
#talkToUs {
8068
h4 {
8169
br {

assets/scss/_tablet.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ $vendor-strip-font-size: 16px;
118118
}
119119
}
120120

121-
#mobileShowVideoButton {
122-
display: none;
123-
}
124-
125121
#talkToUs {
126122
#bigSocial {
127123
div {
Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
{{- $class := .Get "class" -}}
1+
{{- $_hugo_config := `{ "version": 1 }` -}}
2+
{{- $col_id := .Get "color" | default .Ordinal -}}
3+
{{- $height := .Get "height" | default "auto" -}}
4+
{{- $type := .Get "type" | default "" -}}
25
{{- $style := .Get "style" -}}
3-
{{- $id := .Get "id" | default (printf "section-%d" .Ordinal) -}}
6+
{{- $id_fallback := ( printf "td-block-%d" .Ordinal ) -}}
7+
{{- $id := .Get "id" | default (printf "%s%s" $id_fallback "-section" ) -}}
8+
{{- $class := .Get "class" -}}
49
{{- $bg := .Get "background-image" -}}
10+
{{- if $bg -}}
11+
{{- template "shortcodes-blocks_getimage" (dict "name" $bg "ctx" . "target" "bg") }}
12+
{{- end -}}
513
{{/* special case Kubernetes overview */}}
614
{{- if eq $class "k8s-overview" -}}
7-
{{- partial "kubernetes-overview.html" (dict "id" $id "class" $class "inner" $.Inner ) -}}
15+
{{- partial "kubernetes-overview.html" (dict "id" $id "class" $class "inner" $.Inner ) -}}
816
{{- else -}}
9-
{{- if $bg -}}
10-
{{ template "shortcodes-blocks_getimage" (dict "name" $bg "ctx" . "target" "bg") }}
11-
{{- end -}}
17+
<a id="{{ $id_fallback }}" class="td-offset-anchor"></a>
1218
{{- $image := $.Scratch.Get "bg" -}}
13-
<section id="{{ $id }}" class="{{ with $image }}section-with-bgimage{{end}} {{ with $class }}{{ . }}{{ end }}" style="{{ with $image }}background-image: url({{ .Permalink }}); {{ end }}{{ with $style }}{{ . | safeCSS }}{{ end }}">
14-
{{ $.Inner }}
19+
<section id="{{ $id }}" class="row td-box td-box--{{ $col_id }} td-box--gradient td-box--height-{{ $height }}{{ with $class }} {{ . }}{{ end }}{{ with $image }} section-with-bgimage {{ end }}" style="{{ with $image }}background-image: url({{ .Permalink }}); {{ end }}{{ with $style }}{{ . | safeCSS }}{{ end }}">
20+
<div class="col">
21+
<div class="row {{ $type }}">
22+
{{ if eq .Page.File.Ext "md" }}
23+
{{ .Inner | markdownify }}
24+
{{ else }}
25+
{{ .Inner | htmlUnescape | safeHTML }}
26+
{{ end }}
27+
</div>
28+
</div>
1529
</section>
1630
{{- end -}}

0 commit comments

Comments
 (0)