Skip to content

Commit db4d973

Browse files
committed
use jekyll to render the website
1 parent 1e79d78 commit db4d973

File tree

7 files changed

+110
-93
lines changed

7 files changed

+110
-93
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/_site

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Use Jekyll

_layouts/graphs.html

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
6+
<title>{{ page.title }} PR tracking</title>
7+
8+
<link rel="stylesheet" href="web/style.css">
9+
<link rel="shortcut icon" href="web/favicon.ico">
10+
</head>
11+
<body>
12+
<header>
13+
<div class="top-nav">
14+
<div class="nav-wrapper">
15+
<h1>PR tracking</h1>
16+
<nav>
17+
{% for navpage in site.pages %}
18+
<a href="{{ navpage.url }}" {% if page.repo == navpage.repo %}class="active"{% endif %}>{{ navpage.title }}</a>
19+
{% endfor %}
20+
</nav>
21+
</div>
22+
</div>
23+
<div class="bottom-nav">
24+
<div class="nav-wrapper">
25+
<nav>
26+
{% for item in page.graphs %}
27+
<a href="#{{ item[0] }}">{{ item[1] }}</a>
28+
{% endfor %}
29+
</nav>
30+
</div>
31+
</div>
32+
</header>
33+
34+
{% for item in page.graphs %}
35+
<div class="graph" id="{{ item[0] }}">
36+
<h2>{{ item[1] }}</h2>
37+
<canvas></canvas>
38+
</div>
39+
{% endfor %}
40+
41+
<footer>
42+
Number of days:
43+
<input id="days-count" type="text" value="30" maxlength="3">
44+
<br/>
45+
Show percentages instead of absolute numbers:
46+
<input id="relative" type="checkbox" value="false">
47+
</footer>
48+
<footer>
49+
<a class="button" href="https://github.com/rust-lang-nursery/rustc-pr-tracking/tree/master/data">
50+
Explore the raw data
51+
</a>
52+
</footer>
53+
54+
<script type="text/javascript" src="web/chart.min.js"></script>
55+
<script type="text/javascript" src="web/main.js"></script>
56+
</body>
57+
</html>
58+

index.html

-59
This file was deleted.

index.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: rustc
3+
repo: rust-lang/rust
4+
graphs:
5+
pr-status: Pull requests status
6+
pr-activity: Last activity on pull requests
7+
pr-age: Pull requests creation dates
8+
pr-merged: Pull requests merged
9+
layout: graphs
10+
---

web/main.js

-17
Original file line numberDiff line numberDiff line change
@@ -179,23 +179,6 @@ function process_data(graph) {
179179
}
180180

181181

182-
function populate_toc() {
183-
var toc = document.getElementById("toc");
184-
185-
var graphs = document.querySelectorAll(".graph");
186-
for (var i = 0; i < graphs.length; i++) {
187-
var li = document.createElement("li");
188-
var a = document.createElement("a");
189-
a.classList.add("button");
190-
a.href = "#" + graphs[i].id;
191-
a.innerHTML = graphs[i].querySelector("h2").innerHTML;
192-
li.appendChild(a);
193-
toc.appendChild(li);
194-
}
195-
}
196-
197-
198-
populate_toc();
199182
fetch_graphs();
200183

201184

web/style.css

+40-17
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,62 @@
1919
* SOFTWARE.
2020
*/
2121

22+
* {
23+
box-sizing: border-box;
24+
}
2225

2326
body {
2427
font-family: sans-serif;
2528
margin: 0;
2629
padding: 0.5em;
27-
2830
background: #eee;
2931
}
3032

3133
header {
32-
text-align: center;
33-
padding: 2em 0.2em 1em 0.2em;
34+
background: #fff;
35+
margin: -0.5em;
36+
box-shadow: 0 0.2em 0.5em rgba(0, 0, 0, 0.1);
37+
}
3438

35-
background: #eee;
39+
header nav {
40+
display: flex;
3641
}
3742

38-
header h1 {
39-
margin: 0 0 0.3em 0;
43+
header nav a {
44+
padding: 1em;
45+
color: inherit;
46+
text-decoration: none;
4047
}
4148

42-
header p {
43-
margin: 0;
49+
header .nav-wrapper {
50+
max-width: 82em;
51+
margin: auto;
52+
display: flex;
53+
align-items: center;
4454
}
4555

46-
ul#toc {
47-
padding: 0;
48-
margin: 0;
49-
text-align: center;
56+
header .top-nav {
57+
background: #398277;
58+
color: #fff;
5059
}
5160

52-
ul#toc li {
53-
display: inline-block;
54-
margin: 0.25em;
61+
header .top-nav h1 {
62+
font-weight: 400;
63+
font-size: 1.5em;
64+
margin: 0 0.5em;
65+
flex: 1;
66+
}
67+
68+
header .top-nav nav a:hover, header .top-nav nav a.active {
69+
background: rgba(255, 255, 255, 0.1);
70+
}
71+
72+
header .bottom-nav nav a:hover, header .bottom-nav nav a.active {
73+
color: #398277;
74+
}
75+
76+
header p {
77+
margin: 0;
5578
}
5679

5780
.graph {
@@ -82,7 +105,7 @@ footer {
82105

83106

84107
.button {
85-
background: #bf4d28;
108+
background: #398277;
86109
color: #fff;
87110
text-decoration: none;
88111

@@ -91,7 +114,7 @@ footer {
91114
border-radius: 0.3em;
92115

93116
transition: opacity 0.2s ease-out;
94-
box-shadow: 0 0.1em 0.1em rgba(0, 0, 0, 0.5);
117+
box-shadow: 0 0.1em 0.1em rgba(0, 0, 0, 0.2);
95118
}
96119

97120
.button:hover {

0 commit comments

Comments
 (0)