Skip to content

Commit 3e38300

Browse files
committed
Display active JSHint version on front page
1 parent a296a26 commit 3e38300

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

pages/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ <h4>Metrics</h4>
9494

9595
<div class="sidebar">
9696
<h1><img src="/res/jshint-dark.png" alt="JSHint"></h1>
97+
<span class="version">
98+
<a href="{{ urls.latestRelease }}">version {{ version }}</a>
99+
</span>
97100

98101
<ul class="links">
99102
<li><a href="/about">About</a></li>

plugins/variables.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var path = require("path");
77
var fs = require("fs");
88

99
var pkg = require(path.join(
10-
__dirname, "..", "node_modules", "jshint", "package.json")
10+
__dirname, "..", "res", "jshint", "package.json")
1111
);
1212
var contributing = fs.readFileSync(
1313
"res/jshint/CONTRIBUTING.md", { encoding: "utf-8" }
@@ -18,7 +18,8 @@ var context = {
1818
urls: {
1919
repo: "https://github.com/jshint/jshint",
2020
newIssue: "https://github.com/jshint/jshint/issues/new",
21-
newPullRequest: "https://github.com/jshint/jshint/compare"
21+
newPullRequest: "https://github.com/jshint/jshint/compare",
22+
latestRelease: "https://github.com/jshint/jshint/releases/tag/" + pkg.version
2223
}
2324
};
2425

res/styles.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ button:hover {
4444
}
4545

4646
.sidebar ul {
47-
margin: 20px 0 0 0;
47+
margin: 15px 0 0 0;
4848
padding: 0;
4949
font-size: 90%;
5050
font-family: Sans-Serif;
@@ -55,6 +55,12 @@ button:hover {
5555
list-style-type: none;
5656
}
5757

58+
.sidebar .version {
59+
display: block;
60+
text-align: right;
61+
}
62+
63+
.sidebar .version a,
5864
.sidebar li a {
5965
color: #aaa;
6066
}

0 commit comments

Comments
 (0)