@@ -31,10 +31,12 @@ const staticrender = {
3131 canonical = 'https://transit.dymajo.com'
3232 success ( )
3333 } else if ( path [ 1 ] === 's' ) {
34- if ( path . length === 2 ) {
35- return notFound ( )
36- } else if ( path . length === 3 ) {
37- station . _stopInfo ( path [ 2 ] , 'nz-akl' ) . then ( function ( data ) {
34+ if ( path . length === 3 ) {
35+ path . splice ( 2 , 0 , 'nz-akl' )
36+ return res . redirect ( 301 , path . join ( '/' ) )
37+ // return res.redirect(301, ca)
38+ } else if ( path . length === 4 ) {
39+ station . _stopInfo ( path [ 3 ] , 'nz-akl' ) . then ( function ( data ) {
3840 title = data . stop_name + defaultName
3941 description = 'Realtime departures and timetable for '
4042 if ( data . stop_name . toLowerCase ( ) . match ( 'train station' ) ||
@@ -47,12 +49,12 @@ const staticrender = {
4749
4850 success ( )
4951 } ) . catch ( notFound )
50- } else if ( path . length === 5 ) {
51- if ( path [ 3 ] === 'timetable' ) {
52- title = path [ 4 ] . split ( '-' ) [ 0 ] + ' Timetable' + defaultName
52+ } else if ( path . length === 6 ) {
53+ if ( path [ 4 ] === 'timetable' ) {
54+ title = path [ 5 ] . split ( '-' ) [ 0 ] + ' Timetable' + defaultName
5355 description = 'View timetable in DYMAJO Transit.'
5456 success ( )
55- } else if ( path [ 3 ] === 'realtime' ) {
57+ } else if ( path [ 4 ] === 'realtime' ) {
5658 title = 'Realtime Trip Info' + defaultName
5759 description = 'View live vehicle location in DYMAJO Transit.'
5860 success ( )
@@ -64,12 +66,15 @@ const staticrender = {
6466 }
6567 } else if ( path [ 1 ] === 'l' ) {
6668 if ( path . length === 2 ) {
69+ path . splice ( 2 , 0 , 'nz-akl' )
70+ return res . redirect ( 301 , path . join ( '/' ) )
71+ } else if ( path . length === 3 ) {
6772 title = 'Lines' + defaultName
6873 description = 'View all Auckland Bus, Train, and Ferry Services.'
6974 success ( )
70- } else if ( path . length === 3 ) {
71- path [ 2 ] = path [ 2 ] . trim ( )
72- line . _getLine ( path [ 2 ] , function ( err , data ) {
75+ } else if ( path . length === 4 ) {
76+ path [ 3 ] = path [ 3 ] . trim ( )
77+ line . _getLine ( path [ 3 ] , function ( err , data ) {
7378 if ( data . length === 0 ) {
7479 return notFound ( )
7580 } else {
0 commit comments