Define custom section partial for K8s overview

pull/46684/head
Tim Bannister 2024-05-29 17:06:30 +01:00
parent f0ab423e1c
commit fef04ab4c4
5 changed files with 12 additions and 3 deletions

View File

@ -477,7 +477,8 @@ section#cncf {
}
// OCEAN NODES
#oceanNodes {
#oceanNodes, .td-home .k8s-overview {
padding-top: $ocean-nodes-padding-Y;
padding-bottom: $ocean-nodes-padding-Y;

View File

@ -23,7 +23,7 @@ $video-section-height: 550px;
}
}
#oceanNodes {
#oceanNodes, .td-home .k8s-overview {
.main-section {
position: relative;

View File

@ -66,7 +66,7 @@ $feature-box-div-width: 45%;
}
}
#oceanNodes {
#oceanNodes, .td-home .k8s-overview {
h3 {
text-align: left;
margin-bottom: 18px;

View File

@ -0,0 +1,3 @@
<section id="{{ .id }}"{{ with .class }} class="{{ . }}"{{ end }}>
{{ .inner }}
</section>

View File

@ -2,6 +2,10 @@
{{- $style := .Get "style" -}}
{{- $id := .Get "id" | default (printf "section-%d" .Ordinal) -}}
{{- $bg := .Get "background-image" -}}
{{/* special case Kubernetes overview */}}
{{- if eq $class "k8s-overview" -}}
{{- partial "kubernetes-overview.html" (dict "id" $id "class" $class "inner" $.Inner ) -}}
{{- else -}}
{{- if $bg -}}
{{ template "shortcodes-blocks_getimage" (dict "name" $bg "ctx" . "target" "bg") }}
{{- end -}}
@ -9,3 +13,4 @@
<section id="{{ $id }}"{{ with $class }} class="{{ . }}"{{ end }} style="{{ with $image }}background-image: url({{ .Permalink }}); {{ end }}{{ with $style }}{{ . | safeCSS }}{{ end }}">
{{ $.Inner }}
</section>
{{- end -}}