Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit db37f77

Browse files
committed
Switch to rustup installation
1 parent 99dcacc commit db37f77

File tree

6 files changed

+978
-184
lines changed

6 files changed

+978
-184
lines changed

_config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ name: The Rust Programming Language
22
stable: "1.13.0"
33
stable_date: "2016-11-10"
44
stable_blog: "/2016/11/10/Rust-1.13.html"
5+
stable_full_version: "rustc 1.13.0 (2c6933acc 2016-11-07)"
56
beta: "1.14"
67
beta_date: "2016-12-22"
78
nightly: "1.15"
9+
channels:
10+
- name: "stable"
11+
vers: "1.13.0"
12+
package: "1.13.0"
13+
- name: "beta"
14+
vers: "1.14"
15+
package: "beta"
16+
- name: "nightly"
17+
vers: "1.15"
18+
package: "nightly"

_includes/rustup.js

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
var platform_override = null;
2+
3+
function detect_platform() {
4+
"use strict";
5+
6+
if (platform_override) {
7+
return platform_override;
8+
}
9+
10+
var os = "unknown";
11+
12+
if (navigator.platform == "Linux x86_64") {os = "unix";}
13+
if (navigator.platform == "Linux i686") {os = "unix";}
14+
if (navigator.platform == "Linux i686 on x86_64") {os = "unix";}
15+
if (navigator.platform == "Linux aarch64") {os = "unix";}
16+
if (navigator.platform == "Linux armv6l") {os = "unix";}
17+
if (navigator.platform == "Linux armv7l") {os = "unix";}
18+
if (navigator.platform == "Win32") {os = "win";}
19+
if (navigator.platform == "FreeBSD x86_64") {os = "unix";}
20+
if (navigator.platform == "FreeBSD amd64") {os = "unix";}
21+
22+
if (navigator.platform == "Linux armv7l"
23+
&& navigator.appVersion.indexOf("Android") != -1 ) {
24+
os = "android";
25+
}
26+
27+
// I wish I knew by now, but I don't. Try harder.
28+
if (os == "unknown") {
29+
if (navigator.appVersion.indexOf("Win")!=-1) {os = "win";}
30+
if (navigator.appVersion.indexOf("Mac")!=-1) {os = "unix";}
31+
}
32+
33+
return os;
34+
}
35+
36+
function adjust_for_platform() {
37+
"use strict";
38+
39+
var platform = detect_platform();
40+
41+
var unix_div = document.getElementById("platform-instructions-unix");
42+
var win_div = document.getElementById("platform-instructions-win");
43+
var android_div = document.getElementById("platform-instructions-android");
44+
var unknown_div = document.getElementById("platform-instructions-unknown");
45+
var default_div = document.getElementById("platform-instructions-default");
46+
47+
unix_div.style.display = "none";
48+
win_div.style.display = "none";
49+
android_div.style.display = "none";
50+
unknown_div.style.display = "none";
51+
default_div.style.display = "none";
52+
53+
if (platform == "unix") {
54+
unix_div.style.display = "block";
55+
} else if (platform == "win") {
56+
win_div.style.display = "block";
57+
} else if (platform == "android") {
58+
android_div.style.display = "block";
59+
} else if (platform == "unknown") {
60+
unknown_div.style.display = "block";
61+
} else {
62+
default_div.style.display = "block";
63+
}
64+
65+
var platform_specific = document.getElementsByClassName("platform-specific");
66+
for (var el of platform_specific) {
67+
var el_is_not_win = el.className.indexOf("not-win") !== -1;
68+
var el_is_inline = el.tagName.toLowerCase() == "span";
69+
var el_visible_style = "block";
70+
if (el_is_inline) {
71+
el_visible_style = "inline";
72+
}
73+
if (platform == "win") {
74+
if (el_is_not_win) {
75+
el.style.display = "none";
76+
} else {
77+
el.style.display = el_visible_style;
78+
}
79+
} else {
80+
if (el_is_not_win) {
81+
el.style.display = el_visible_style;
82+
} else {
83+
el.style.display = "none";
84+
}
85+
}
86+
}
87+
}
88+
89+
function cycle_platform() {
90+
if (platform_override == null) {
91+
platform_override = "default";
92+
} else if (platform_override == "default") {
93+
platform_override = "unknown";
94+
} else if (platform_override == "unknown") {
95+
platform_override = "win";
96+
} else if (platform_override == "win") {
97+
platform_override = "unix";
98+
} else if (platform_override == "unix") {
99+
platform_override = "android";
100+
} else if (platform_override == "android") {
101+
platform_override = "default";
102+
}
103+
adjust_for_platform();
104+
}
105+
106+
function set_up_cycle_button() {
107+
var cycle_button = document.getElementById("platform-button");
108+
cycle_button.onclick = cycle_platform;
109+
110+
var key="test";
111+
var idx=0;
112+
var unlocked=false;
113+
114+
document.onkeypress = function(event) {
115+
if (event.key == "n" && unlocked) {
116+
cycle_platform();
117+
}
118+
119+
if (event.key == key[idx]) {
120+
idx += 1;
121+
122+
if (idx == key.length) {
123+
cycle_button.style.display = "block";
124+
unlocked = true;
125+
cycle_platform();
126+
}
127+
} else if (event.key == key[0]) {
128+
idx = 1;
129+
} else {
130+
idx = 0;
131+
}
132+
};
133+
}
134+
135+
function fill_in_bug_report_values() {
136+
var nav_plat = document.getElementById("nav-plat");
137+
var nav_app = document.getElementById("nav-app");
138+
nav_plat.textContent = navigator.platform;
139+
nav_app.textContent = navigator.appVersion;
140+
}
141+
142+
(function () {
143+
adjust_for_platform();
144+
set_up_cycle_button();
145+
fill_in_bug_report_values();
146+
}());

css/style.css

Lines changed: 169 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ div.install {
148148
}
149149

150150
.pitch-row {
151-
margin-bottom: 2em;
151+
margin-bottom: 0em;
152152
}
153153

154154
p.pitch {
@@ -377,15 +377,15 @@ ul.laundry-list {
377377
line-height: 1.5em;
378378
margin: 3rem 0 1rem;
379379
font-weight: 400;
380-
border-top: 2px solid #dedede;
381-
padding-top: 1rem;
380+
border-top: 2px solid #dedede;
381+
padding-top: 1rem;
382382
}
383383

384384
.content h3 {
385385
font-size: 1em;
386386
line-height: 1.5em;
387387
font-weight: 500;
388-
margin: .5rem 0;
388+
margin: 2rem 0;
389389
}
390390

391391
.side-header h2 {
@@ -593,3 +593,168 @@ footer a {
593593
display: inline-block;
594594
font-weight: bold;
595595
}
596+
597+
/* rustup install page styles */
598+
599+
.instructions {
600+
background-color: rgb(250, 250, 250);
601+
margin-left: auto;
602+
margin-right: auto;
603+
width: 34rem;
604+
text-align: center;
605+
border-radius: 3px;
606+
border: 1px solid rgb(204, 204, 204);
607+
box-shadow: 0px 1px 4px 0px rgb(204, 204, 204);
608+
margin-top: 4rem;
609+
margin-bottom: 4rem;
610+
}
611+
612+
.instructions > * {
613+
width: 30rem;
614+
margin-left: auto;
615+
margin-right: auto;
616+
}
617+
618+
.instructions p {
619+
margin-left: auto;
620+
margin-right: auto;
621+
margin-top: 2rem;
622+
margin-bottom: 2rem;
623+
}
624+
625+
.instructions hr {
626+
margin-top: 2rem;
627+
margin-bottom: 2rem;
628+
}
629+
630+
#platform-instructions-unix > pre,
631+
#platform-instructions-default > div > pre {
632+
background-color: #515151;
633+
color: white;
634+
margin-left: auto;
635+
margin-right: auto;
636+
padding-top: 1rem;
637+
padding-bottom: 1rem;
638+
text-align: center;
639+
border-radius: 3px;
640+
box-shadow: inset 0px 0px 20px 0px #444444;
641+
margin-top: 2rem;
642+
margin-bottom: 2rem;
643+
}
644+
645+
#platform-instructions-win a,
646+
#platform-instructions-default a {
647+
display: block;
648+
padding-top: 0.4rem;
649+
padding-bottom: 0.6rem;
650+
font-family: 'Fira Sans', "Helvetica Neue", Helvetica, Arial, sans-serif;
651+
font-weight: 500;
652+
letter-spacing: 0.1rem;
653+
}
654+
655+
#platform-instructions-unknown div {
656+
line-height: 2rem;
657+
}
658+
659+
#platform-button {
660+
width: 100%;
661+
font-size: 70%;
662+
text-align: center;
663+
margin-top: 1em;
664+
margin-bottom: 1em;
665+
background-color: #515151;
666+
color: white;
667+
margin-left: auto;
668+
margin-right: auto;
669+
padding: 1em;
670+
}
671+
672+
.install-examples {
673+
margin-top: 2rem;
674+
margin-bottom: 2rem
675+
}
676+
677+
.install-example-row > div:first-child {
678+
text-align: right;
679+
margin-top: 1rem
680+
}
681+
682+
.install-example-row > div:last-child {
683+
margin-top: 0rem;
684+
margin-bottom: 1rem;
685+
}
686+
687+
.pitch-row .release-button {
688+
display: block;
689+
color: white;
690+
background-color: #428BCA;
691+
border-radius: 3px;
692+
padding-left: 4rem;
693+
padding-top: 2rem;
694+
padding-bottom: 2rem;
695+
margin-top: 4rem;
696+
}
697+
698+
.release-info-column > div {
699+
margin-top: 4rem;
700+
}
701+
702+
.release-info-column > div > div:first-child {
703+
}
704+
705+
.release-info-column .release-version {
706+
font-size: 1.5em;
707+
font-weight: 500;
708+
}
709+
710+
.release-info-column .release-date {
711+
font-weight: 500;
712+
}
713+
714+
/* de-emphasize the header to draw attention to the instructions */
715+
h1.rustup,
716+
h1.rustup ~ h2 {
717+
color: #999;
718+
font-size: 2em; /* same as h2 */
719+
font-size: 2em;
720+
line-height: 1.5em;
721+
margin: 3rem 0 1rem;
722+
font-weight: 400;
723+
border-top: 2px solid #dedede;
724+
padding-top: 1rem;
725+
}
726+
727+
.rustup-init-table {
728+
display: flex;
729+
margin: 2rem;
730+
justify-content: space-around;
731+
}
732+
733+
.rustup-init-table > div > a {
734+
display: block;
735+
}
736+
737+
.installer-table {
738+
display: flex;
739+
margin: 2rem;
740+
justify-content: space-around;
741+
}
742+
743+
.installer-table > div > div {
744+
text-align: right
745+
}
746+
747+
.installer-table > div > div > span {
748+
float: left;
749+
margin-left: 1em;
750+
margin-right: 1em;
751+
}
752+
753+
.installer-table > div > div > a {
754+
margin-left: 1em;
755+
margin-right: 1em;
756+
}
757+
758+
.installer-table.stable .no-stable {
759+
display: none;
760+
}

en-US/index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
---
55

66
<div class="row pitch-row">
7-
<div class="col-md-2"></div>
87
<div class="col-md-8">
98
<p class="pitch">
109
<b>Rust</b> is a systems programming language
@@ -15,7 +14,13 @@
1514
<b><a href="friends.html">See who's using Rust.</a></b>
1615
</p>
1716
</div>
18-
<div class="col-md-2"></div>
17+
<div class="col-md-4 release-info-column">
18+
<a class="release-button" href="install.html">
19+
<div>Current release</div>
20+
<div class="release-version">{{ site.stable }}</div>
21+
<div class="release-date">{{ site.stable_date | date: "%B %-d, %Y" }}</div>
22+
</a>
23+
</div>
1924
</div>
2025

2126
<div class="row code-row">

0 commit comments

Comments
 (0)