Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Rules
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ route '/**/index.*' do
item.identifier.without_ext + '.html'
end

route '/404.html' do
'/404.html'
end

route '/**/*' do
item.identifier.without_ext + '/index.html'
end
Expand Down
8 changes: 8 additions & 0 deletions assets/javascripts/initial.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// before anything happens, check if this is a versionless enterprise URL
path = window.location.pathname;
paths = path.split("/");
if (paths[1] == "enterprise" && (paths[2].length === 0 || isNaN(paths[2]))) {
paths.splice(2, 0, String({{ site.version }}));
suffix = window.location.search || window.location.hash;
window.location.href = window.location.protocol + "//" + window.location.host + paths.join("/") + suffix;
}
7 changes: 7 additions & 0 deletions content/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: GitHub Help • Article not found!
exclude_from_search: true
---
<div class="not-found-container">
<h2>Whoops, looks like that page doesn't exist.</h2>
</div>
5 changes: 4 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ gulp.task("javascript", function () {
gulp.src("assets/javascripts/dev_mode.js")
.pipe(gulp.dest("output/assets/javascripts/"));
return gulp.src([
"assets/javascripts/initial.js",
"assets/javascripts/documentation.js",
"assets/javascripts/search.js",
"assets/javascripts/images.js",
"assets/vendor/retinajs/src/retinajs"
])
.pipe(gulpif(transformCS, coffee()))
.pipe(concat("application.js"))
.pipe(replace(/\{\{ site\.version \}\}/g, CONFIG.latest_enterprise_version))
.pipe(gulpif(IS_PRODUCTION, uglify()))
.pipe(gulp.dest("output/assets/javascripts"));
});
Expand Down Expand Up @@ -78,7 +80,8 @@ gulp.task("server", function() {
connect = require("gulp-connect");
connect.server({
port: 4000,
root: ["output"]
root: ["output"],
fallback: "output/404.html"
});
});

Expand Down
4 changes: 3 additions & 1 deletion nanoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ pipeline_config:
asset_root: https://a248.e.akamai.net/assets.github.com/images/icons

versions:
- &latest_version_number 2.4
- &latest_enterprise_version 2.4
- 2.3
- 2.2
- 2.1
- 2.0

latest_enterprise_version: *latest_enterprise_version

data_variables:
-
scope:
Expand Down
2 changes: 2 additions & 0 deletions tasks/utils.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'json'

def config
@config ||= symbolize_hash(YAML.load_file(File.join(File.dirname(__FILE__), '..', 'nanoc.yaml')))
end
Expand Down