Skip to content

Commit 7824ed9

Browse files
authored
Merge pull request #47789 from sftim/20240904_docsy_friendly_footer
Use Docsy friendly footer
2 parents 793fb6d + 4444539 commit 7824ed9

File tree

3 files changed

+78
-27
lines changed

3 files changed

+78
-27
lines changed

assets/scss/_base.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,11 @@ section#cncf {
893893
}
894894
}
895895

896+
footer.row {
897+
margin-left: initial;
898+
margin-right: initial;
899+
}
900+
896901
/* DOCUMENTATION */
897902

898903
// nav-tabs and tab-content

assets/scss/_custom.scss

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,26 @@ body.td-404 main .error-details {
266266

267267
/* FOOTER */
268268
footer {
269-
background-color: #303030;
269+
background-color: #202020;
270+
/* darkened later in this file */
270271
background-image: url("/images/texture.png");
271272
padding: 1rem !important;
272273
min-height: initial !important;
274+
justify-content: center;
273275

274276
> div, > p {
275277
max-width: 95%;
276278
@media only screen and (min-width: 768px) {
277279
max-width: calc(min(80rem,90vw)); // avoid spreading too wide
278280
}
281+
color: inherit;
282+
background: transparent;
283+
284+
a:hover {
285+
color: inherit;
286+
background: transparent;
287+
text-decoration: underline;
288+
}
279289
}
280290

281291
> .footer__links {
@@ -313,6 +323,50 @@ footer {
313323
}
314324
}
315325

326+
footer {
327+
background-image: linear-gradient(rgba(0, 0, 0, 0.527),rgba(0, 0, 0, 0.5)) , url("/images/texture.png");
328+
color: #e9e9e9;
329+
}
330+
331+
// Custom footer sizing
332+
@media (min-width: 800px) and (max-width: 1279px) {
333+
footer {
334+
ul.footer-icons {
335+
min-width: 17.5vw;
336+
display: flex;
337+
flex-wrap: nowrap;
338+
flex-direction: row;
339+
justify-content: space-evenly;
340+
}
341+
.col-sm-2 {
342+
flex: 0 0 22.5%;
343+
max-width: 22.5%;
344+
}
345+
.footer-main.text-center {
346+
flex: 0 0 50%;
347+
max-width: 50%;
348+
}
349+
350+
}
351+
}
352+
353+
354+
@media (max-width: 799px) {
355+
footer ul.footer-icons {
356+
display: flex;
357+
flex-wrap: nowrap;
358+
flex-direction: column;
359+
align-items: flex-start;
360+
row-gap: 0.5em;
361+
}
362+
footer div.order-1 ul.footer-icons {
363+
margin-left: auto;
364+
}
365+
footer div.order-3 ul.footer-icons {
366+
margin-right: auto;
367+
}
368+
}
369+
316370
/* SIDE-DRAWER MENU */
317371

318372
.pi-pushmenu .sled {

layouts/partials/footer.html

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,44 @@
11
{{ $links := .Site.Params.links }}
2-
<footer class="d-print-none">
3-
<div class="footer__links">
4-
<nav>
5-
{{ with site.GetPage "page" "docs/tutorials/stateless-application/hello-minikube" }}<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
6-
{{ $sections := slice "docs/home" "blog" "training" "partners" "community" "case-studies" }}
7-
{{ range $sections }}
8-
{{ with site.GetPage "section" . }}<a class="text-white" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ end }}
9-
{{ end }}
10-
</nav>
11-
</div>
12-
<div class="container-fluid">
2+
<footer class="bg-dark py-5 row d-print-none">
3+
<div class="container-fluid mx-sm-5">
134
<div class="row">
14-
<div class="col-6 col-sm-2 text-xs-center order-sm-2">
5+
{{ template "footer-main-block" . }}
6+
<div class="col col-sm-2 text-xs-center order-1">
157
{{ with $links }}
168
{{ with index . "user"}}
179
{{ template "footer-links-block" . }}
1810
{{ end }}
1911
{{ end }}
2012
</div>
21-
<div class="col-6 col-sm-2 text-right text-xs-center order-sm-3">
13+
<div class="col col-sm-2 text-right text-xs-center order-3">
2214
{{ with $links }}
2315
{{ with index . "developer"}}
2416
{{ template "footer-links-block" . }}
2517
{{ end }}
2618
{{ end }}
2719
</div>
28-
<div class="col-12 col-sm-8 text-center order-sm-2">
29-
{{ with .Site.Params.copyright_k8s }}<small class="text-white">&copy; {{ now.Year}} {{ T "main_documentation_license" | safeHTML }}</small>{{ end }}
30-
<br/>
31-
{{ with .Site.Params.copyright_linux }}<small class="text-white">Copyright &copy; {{ now.Year }} {{ T "main_copyright_notice" | safeHTML }}</small>{{ end }}
32-
<br/>
33-
<small class="text-white">{{ T "china_icp_license" }} 京ICP备17074266号-3</small>
34-
{{ with .Site.Params.privacy_policy }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_privacy_policy" }}</a></small>{{ end }}
35-
{{ if not .Site.Params.ui.footer_about_disable }}
36-
{{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }}
37-
{{ end }}
38-
</div>
3920
</div>
4021
</div>
4122
</footer>
4223
{{ define "footer-links-block" }}
43-
<ul class="list-inline mb-0">
24+
<ul class="list-inline mb-0 footer-icons">
4425
{{ range . }}
4526
<li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="{{ .name }}" aria-label="{{ .name }}">
46-
<a class="text-white" target="_blank" href="{{ .url }}">
27+
<a class="text-white" target="_blank" rel="noopener" href="{{ .url }}" aria-label="{{ .name }}">
4728
<i class="{{ .icon }}"></i>
4829
</a>
4930
</li>
5031
{{ end }}
5132
</ul>
5233
{{ end }}
34+
{{ define "footer-main-block" }}
35+
<div class="col-5 col-sm-7 text-center order-2 footer-main">
36+
<p><span class="copyright-notice">&copy; {{ now.Year}} {{ T "main_documentation_license" | safeHTML }}</span></p>
37+
<p><span class="copyright-notice">&copy; {{ now.Year }} {{ T "main_copyright_notice" | safeHTML }}</span></p>
38+
<p><span class="certification-notice">{{ T "china_icp_license" }} 京ICP备17074266号-3</span></p>
39+
{{ with .Site.Params.privacy_policy }}<p><span class="ml-1 privacy-policy"><a href="{{ . }}" target="_blank">{{ T "footer_privacy_policy" }}</a></span></p>{{ end }}
40+
{{ if not .Site.Params.ui.footer_about_disable }}
41+
{{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }}
42+
{{ end }}
43+
</div>
44+
{{ end }}

0 commit comments

Comments
 (0)