Skip to content

Commit 24a6003

Browse files
Add footer with link to the Policy page and to the Rust Foundation
1 parent 55c7386 commit 24a6003

File tree

8 files changed

+83
-18
lines changed

8 files changed

+83
-18
lines changed

templates/base.html

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
{%- block header %}{% endblock header -%}
3030

3131
{%- block body -%}{%- endblock body -%}
32+
{%- include "footer.html" -%}
3233

3334
<script type="text/javascript" nonce="{{ csp_nonce }}" src="/-/static/menu.js?{{ docsrs_version() | slugify }}"></script>
3435
<script type="text/javascript" nonce="{{ csp_nonce }}" src="/-/static/index.js?{{ docsrs_version() | slugify }}"></script>

templates/footer.html

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="docs-rs-footer">
2+
<a href="/about">About docs.rs</a>
3+
<a href="https://foundation.rust-lang.org/policies/privacy-policy/#docs.rs">Privacy policy</a>
4+
<a href="/releases/queue">Build queue</a>
5+
</div>

templates/header/topbar_begin.html

-14
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,6 @@
3434

3535
#}<ul class="pure-menu-list pure-menu-right">
3636
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover pure-menu-opt-children">
37-
<a href="/about" class="pure-menu-link">
38-
<span title="About">{{ "info-circle" | fas }}</span>
39-
<span class="title">About</span>
40-
</a>
41-
42-
<ul class="pure-menu-children">
43-
{{ macros::menu_link(href="/about/badges", text="Badges") }}
44-
{{ macros::menu_link(href="/about/builds", text="Builds") }}
45-
{{ macros::menu_link(href="/about/metadata", text="Metadata") }}
46-
{{ macros::menu_link(href="/about/redirections", text="Shorthand URLs") }}
47-
</ul>
48-
</li>{#
49-
50-
#}<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover pure-menu-opt-children">
5137
<a href="/releases" class="pure-menu-link">
5238
<span title="Releases">{{ "leaf" | fas }}</span>
5339
<span class="title">Releases</span>

templates/rustdoc/body.html

+1
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@
3333

3434
{# see comment in ../../static/storage-change-detection.html for details #}
3535
<iframe src="/-/static/storage-change-detection.html" width="0" height="0" style="display: none"></iframe>
36+
{%- include "footer.html" -%}

templates/style/_vars.scss

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ $font-family-mono: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono
77

88
// Sizes
99
$top-navbar-height: 32px; // height of the floating top navbar
10+
$footer-height: 30px; // height of the floating footer
1011

1112
// Pure compatible media queries
1213
// usage:

templates/style/base.scss

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FIXME: Use modules
2-
@import "vars", "utils", "navbar", "themes", "fa";
2+
@import "vars", "utils", "navbar", "themes", "fa", "footer";
33

44
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
55
@font-face {
@@ -74,6 +74,8 @@ textarea,
7474
body {
7575
padding: 0;
7676
margin: 0;
77+
position: relative;
78+
min-height: calc(100vh - #{$top-navbar-height});
7779

7880
* {
7981
-webkit-box-sizing: border-box;
@@ -180,6 +182,11 @@ div.container {
180182
max-width: 1160px;
181183
margin: 0 auto;
182184
text-align: left;
185+
186+
> .chartjs-render-monitor {
187+
// This is to prevent the canvas text to go under the footer.
188+
padding-bottom: 35px;
189+
}
183190
}
184191

185192
div.landing {
@@ -211,7 +218,7 @@ div.landing {
211218

212219
div.recent-releases-container {
213220
text-align: left;
214-
margin-bottom: 50px;
221+
padding-bottom: 50px;
215222

216223
ul,
217224
li {
@@ -396,9 +403,10 @@ div.package-sheet-container {
396403
}
397404

398405
div.package-page-container {
406+
padding-bottom: 50px;
407+
399408
div.package-menu {
400409
padding: 0 10px;
401-
margin-bottom: 50px;
402410

403411
li.pure-menu-heading {
404412
font-size: 1.3em;

templates/style/footer.scss

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@import "vars";
2+
3+
.docs-rs-footer {
4+
position: absolute;
5+
bottom: 0;
6+
right: 0;
7+
width: 100%;
8+
text-align: center;
9+
font-size: 0.9em;
10+
height: $footer-height;
11+
background: var(--color-background);
12+
border-top: 1px solid var(--color-border);
13+
font-family: $font-family-sans;
14+
15+
> a {
16+
font-weight: 400;
17+
border-right: 1px solid var(--color-border);
18+
padding: 4px 8px;
19+
height: 100%;
20+
display: inline-block;
21+
color: var(--color-navbar-standard);
22+
23+
&:hover {
24+
color: var(--color-standard);
25+
}
26+
&:first-child {
27+
border-left: 1px solid var(--color-border);
28+
}
29+
}
30+
}

templates/style/rustdoc.scss

+34-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// FIXME: Use modules
2-
@import "vars", "navbar", "themes", "fa";
2+
@import "vars", "navbar", "themes", "fa", "footer";
3+
4+
// This rule is needed to be sure that the footer will always be at the bottom of the page.
5+
body.rustdoc-page {
6+
min-height: 100vh;
7+
}
38

49
// Force the navbar to be left-aligned on rustdoc pages
510
body.rustdoc-page > .nav-container > .container {
@@ -8,6 +13,34 @@ body.rustdoc-page > .nav-container > .container {
813

914
div.container-rustdoc {
1015
text-align: left;
16+
17+
> .docs-rs-footer {
18+
bottom: -20px;
19+
}
20+
}
21+
22+
div.container-rustdoc:not(.source) {
23+
> .docs-rs-footer {
24+
right: -15px;
25+
width: calc(100vw - 212px);
26+
}
27+
28+
// This is when the rustdoc sidebar "disappears" (for mobile mode).
29+
@media (max-width: 700px) {
30+
> .docs-rs-footer:not(.source) {
31+
width: 100vw;
32+
}
33+
}
34+
}
35+
36+
div.container-rustdoc.source {
37+
> .docs-rs-footer {
38+
width: 100vw;
39+
left: -15px;
40+
// This is needed because even though the sidebar only contains the header, it still takes
41+
// all the height.
42+
z-index: 1;
43+
}
1144
}
1245

1346
// this is a super nasty override for help dialog in rustdocs

0 commit comments

Comments
 (0)