File tree Expand file tree Collapse file tree 3 files changed +34
-5
lines changed
Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Original file line number Diff line number Diff line change 11---
22permalink: /404.html
33layout: default
4+ tab: 100
45---
56
67< div class ="container ">
7- < h1 > 404</ h1 >
8+ < div v-if ="isDocsPage() ">
9+ < h1 > 404</ h1 >
10+ < p > < strong > Page not found</ strong > </ p >
11+ < p > This version of the documentation does not contain this page. Please go to the < a :href ="getMainDocsPage() "> main documentation page</ a > .
12+ </ div >
13+ < div v-else >
814
9- < p > < strong > Page not found :(</ strong > </ p >
10- < p > The requested page could not be found.</ p >
15+ < h1 > 404</ h1 >
16+
17+ < p > < strong > Page not found</ strong > </ p >
18+ < p > The requested page could not be found.</ p >
19+ </ div >
1120</ div >
Original file line number Diff line number Diff line change 99 } ,
1010 methods : {
1111 getSortedVersionLabels : getSortedVersionLabels ,
12- setVersion : setVersion
12+ setVersion : setVersion ,
13+ getMainDocsPage : getMainDocsPage ,
14+ isDocsPage : isDocsPage
1315 }
1416 } ) ;
1517
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ function setVersion() {
219219 * currently displayed documentation version.
220220 */
221221function getCurrentVersion ( ) {
222- v = splitLocation ( ) [ 1 ] ;
222+ var v = splitLocation ( ) [ 1 ] ;
223223 if ( v == "" ) {
224224 return v ;
225225 }
@@ -228,4 +228,22 @@ function getCurrentVersion() {
228228 }
229229}
230230
231+ /**
232+ * Returns the main documentation page for the current version by removing
233+ * everything after <code>"../docs/v/x.y.z/"</code> from the current URL.
234+ */
235+ function getMainDocsPage ( ) {
236+ var s = splitLocation ( ) ;
237+
238+ return s [ 0 ] + "/" + s [ 1 ] + "/" ;
239+ }
240+
241+ /**
242+ * Returns true if the current URL points to a versioned documentation
243+ * page.
244+ */
245+ function isDocsPage ( ) {
246+ return window . location . href . includes ( "/docs/v/" ) ;
247+ }
248+
231249initVersions ( ) ;
You can’t perform that action at this time.
0 commit comments