This repository was archived by the owner on Nov 1, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +28
-2
lines changed
Expand file tree Collapse file tree 6 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ route '/**/index.*' do
7575 item . identifier . without_ext + '.html'
7676end
7777
78+ route '/404.html' do
79+ '/404.html'
80+ end
81+
7882route '/**/*' do
7983 item . identifier . without_ext + '/index.html'
8084end
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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 ( / \{ \{ s i t e \. v e r s i o n \} \} / 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
Original file line number Diff line number Diff line change @@ -13,12 +13,14 @@ pipeline_config:
1313 asset_root : https://a248.e.akamai.net/assets.github.com/images/icons
1414
1515versions :
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+
2224data_variables :
2325 -
2426 scope :
Original file line number Diff line number Diff line change 1+ require 'json'
2+
13def config
24 @config ||= symbolize_hash ( YAML . load_file ( File . join ( File . dirname ( __FILE__ ) , '..' , 'nanoc.yaml' ) ) )
35end
You can’t perform that action at this time.
0 commit comments