We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 258827b commit 5e3d3e0Copy full SHA for 5e3d3e0
docs/scripts/page.js
@@ -1,3 +1,21 @@
1
+if ( ! window.frameElement && window.location.protocol !== 'file:' ) {
2
+
3
+ // navigates to docs home if direct access, e.g.
4
+ // https://threejs.org/docs/pages/BoxGeometry.html
5
+ // ->https://threejs.org/docs/#BoxGeometry
6
7
+ const url = new URL( window.location.href );
8
9
+ // hash route, e.g. #BoxGeometry
10
+ url.hash = url.pathname.replace( /\/docs\/pages\/(.*?)(?:\.html)?$/, '$1' );
11
12
+ // docs home, e.g. https://threejs.org/docs/
13
+ url.pathname = url.pathname.replace( /(\/docs\/).*$/, '$1' );
14
15
+ window.location.replace( url );
16
17
+}
18
19
// Initialize Highlight.js for syntax highlighting
20
if ( typeof hljs !== 'undefined' ) {
21
0 commit comments