Skip to content

Commit 7a8ba2a

Browse files
committed
Standardize page titles
1 parent 91a60b7 commit 7a8ba2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

etc/typedoc/theme/assets/js/theme.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@
5959
*/
6060
function cleanTitle( el ) {
6161
var txt = cleanPath( el.innerHTML );
62-
if ( txt.indexOf( 'stdlib' ) === -1 ) {
62+
var idx = txt.indexOf( 'stdlib' );
63+
if ( idx === -1 || idx === 1 ) { // e.g., '@stdlib/types/iter'
6364
txt = 'stdlib | ' + txt;
65+
} else if ( txt.indexOf( ' | stdlib' ) === txt.length-9 ) { // e.g., 'foo/bar | stdlib'
66+
txt = 'stdlib | ' + txt.slice( 0, -9 );
6467
}
6568
el.innerHTML = txt;
6669
}

0 commit comments

Comments
 (0)