Skip to content

Commit 57b2705

Browse files
committed
Remove footer
Move "About" and "Privacy policy" into the Rust menu. The footer required a lot of workarounds to work with the various bits of HTML that rustdoc (and doc authors!) generated. It's hard enough to make the topbar work consistently; adding a footer to nearly-arbitrary HTML is too much, particularly when we can achieve the same thing in the topbar.
1 parent 4b0a958 commit 57b2705

File tree

8 files changed

+12
-98
lines changed

8 files changed

+12
-98
lines changed

templates/footer.html

-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
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">Queue</a>
5-
</div>

templates/header/topbar_end.html

+10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@
2424
#}<li class="pure-menu-item pure-menu-has-children">
2525
<a href="#" class="pure-menu-link" aria-label="Rust">Rust</a>
2626
<ul class="pure-menu-children">
27+
{{ macros::menu_link(
28+
href="https://docs.rs/about",
29+
text="About docs.rs",
30+
target="_blank"
31+
) }}
32+
{{ macros::menu_link(
33+
href="https://foundation.rust-lang.org/policies/privacy-policy/#docs.rs",
34+
text="Privacy policy",
35+
target="_blank"
36+
) }}
2737
{{ macros::menu_link(
2838
href="https://www.rust-lang.org/",
2939
text="Rust website",

templates/style/_footer.scss

-30
This file was deleted.

templates/style/_rustdoc-common.scss

+1-28
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
// FIXME: Use modules
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-
#rustdoc_body_wrapper {
6-
min-height: calc(100vh - #{$footer-height + 2});
7-
}
2+
@import "vars", "navbar", "themes", "fa";
83

94
#clipboard {
105
cursor: pointer;
@@ -17,34 +12,12 @@ body.rustdoc-page > .nav-container > .container {
1712

1813
div.container-rustdoc {
1914
text-align: left;
20-
21-
> .docs-rs-footer {
22-
width: unset;
23-
}
2415
}
2516

2617
div.container-rustdoc {
2718
width: unset;
2819
}
2920

30-
div.container-rustdoc:not(.source) {
31-
// This is when the rustdoc sidebar "disappears" (for mobile mode).
32-
@media (max-width: 700px) {
33-
> .docs-rs-footer:not(.source) {
34-
left: -15px;
35-
}
36-
}
37-
}
38-
39-
div.container-rustdoc {
40-
> .docs-rs-footer {
41-
left: -15px;
42-
// This is needed because even though the sidebar only contains the header, it still takes
43-
// all the height, going over the footer.
44-
z-index: 1;
45-
}
46-
}
47-
4821
// this is a super nasty override for help dialog in rustdocs
4922
// see #52 for details
5023
body.blur {

templates/style/_vars.scss

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ $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
1110

1211
// Pure compatible media queries
1312
// usage:

templates/style/rustdoc-2021-12-05.scss

-13
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,13 @@
1313
height: calc(100vh - #{$top-navbar-height});
1414
/* Since we use `overflow-wrap: anywhere;`, we never have the need for a X scrollbar... */
1515
overflow-x: hidden;
16-
17-
.sidebar-menu {
18-
top: $top-navbar-height;
19-
margin-bottom: $footer-height;
20-
}
2116
}
2217

2318
main {
2419
padding-bottom: 50px;
2520
}
2621
}
2722

28-
div.container-rustdoc {
29-
> .docs-rs-footer {
30-
bottom: 0;
31-
right: 0;
32-
left: 0;
33-
}
34-
}
35-
3623
@media (max-width: 700px) {
3724
.source main {
3825
height: auto;

templates/style/rustdoc.scss

-11
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@
33

44
div.container-rustdoc {
55
text-align: left;
6-
7-
> .docs-rs-footer {
8-
bottom: -32px;
9-
right: -15px;
10-
}
116
}
127

138

14-
div.container-rustdoc:not(.source) {
15-
> .docs-rs-footer {
16-
left: 185px; // This is the left sidebar
17-
}
18-
}
19-
209
div.rustdoc {
2110
#sidebar-toggle {
2211
top: 62px;

templates/style/style.scss

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

44
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
55
@font-face {
@@ -197,10 +197,6 @@ body {
197197
g.highcharts-grid > path {
198198
stroke: var(--chart-grid) !important;
199199
}
200-
201-
> .about-page {
202-
padding-bottom: calc(#{$footer-height} + 2px);
203-
}
204200
}
205201

206202
pre {
@@ -213,11 +209,6 @@ div.container {
213209
max-width: 1160px;
214210
margin: 0 auto;
215211
text-align: left;
216-
217-
> .chartjs-render-monitor {
218-
// This is to prevent the canvas text to go under the footer.
219-
padding-bottom: 35px;
220-
}
221212
}
222213

223214
div.landing {

0 commit comments

Comments
 (0)