8000 Sync changes from upstream repository · viktorthang/developer.github.com@7f93faa · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f93faa

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent db4576f commit 7f93faa

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

Rules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ route '/**/index.*' do
7575
item.identifier.without_ext + '.html'
7676
end
7777

78+
route '/404.html' do
79+
'/404.html'
80+
end
81+
7882
route '/**/*' do
7983
item.identifier.without_ext + '/index.html'
8084
end

assets/javascripts/initial.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// before anything happens, check if this is a versionless enterprise URL
2+
path = window.location.pathname;
3+
paths = path.split("/");
4+
if (paths[1] == "enterprise" && (paths[2].length === 0 || isNaN(paths[2]))) {
5+
paths.splice(2, 0, String({{ site.version }}));
6+
suffix = window.location.search || window.location.hash;
7+
window.location.href = window.location.protocol + "//" + window.location.host + paths.join("/") + suffix;
8+
}

content/404.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: GitHub Help • Article not found!
3+
exclude_from_search: true
4+
---
5+
<div class="not-found-container">
6+
<h2>Whoops, looks like that page doesn't exist.</h2>
7+
</div>

gulpfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ gulp.task("javascript", function () {
3737
gulp.src("assets/javascripts/dev_mode.js")
3838
.pipe(gulp.dest("output/assets/javascripts/"));
3939
return gulp.src([
40+
"assets/javascripts/initial.js",
4041
"assets/javascripts/documentation.js",
4142
"assets/javascripts/search.js",
4243
"assets/javascripts/images.js",
4344
"assets/vendor/retinajs/src/retinajs"
4445
])
4546
.pipe(gulpif(transformCS, coffee()))
4647
.pipe(concat("application.js"))
48+
.pipe(replace(/\{\{ site\.version \}\}/g, CONFIG.latest_enterprise_version))
4749
.pipe(gulpif(IS_PRODUCTION, uglify()))
4850
.pipe(gulp.dest("output/assets/javascripts"));
4951
});
@@ -78,7 +80,8 @@ gulp.task("server", function() {
7880
connect = require("gulp-connect");
7981
connect.server({
8082
port: 4000,
81-
root: ["output"]
83+
root: ["output"],
84+
fallback: "output/404.html"
8285
});
8386
});
8487

nanoc.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ pipeline_config:
1313
asset_root: https://a248.e.akamai.net/assets.github.com/images/icons
1414

1515
versions:
16-
- &latest_version_number 2.4
16+
- &latest_enterprise_version 2.4
1717
- 2.3
1818
- 2.2
1919
- 2.1
2020
- 2.0
2121

22+
latest_enterprise_version: *latest_enterprise_version
23+
2224
data_variables:
2325
-
2426
scope:

tasks/utils.rake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'json'
2+
13
def config
24
@config ||= symbolize_hash(YAML.load_file(File.join(File.dirname(__FILE__), '..', 'nanoc.yaml')))
35
end

0 commit comments

Comments
 (0)
90
0