11import { merge , hyphenate , isPrimitive , hasOwn } from './util/core'
22
3+ const currentScript = document . currentScript
4+
35export default function ( ) {
46 const config = merge (
57 {
@@ -36,7 +38,7 @@ export default function () {
3638 )
3739
3840 const script =
39- document . currentScript ||
41+ currentScript ||
4042 [ ] . slice
4143 . call ( document . getElementsByTagName ( 'script' ) )
4244 . filter ( n => / d o c s i f y \. / . test ( n . src ) ) [ 0 ]
@@ -51,26 +53,22 @@ export default function () {
5153 }
5254 }
5355 }
56+ }
5457
55- if ( config . loadSidebar === true ) {
56- config . loadSidebar = '_sidebar' + config . ext
57- }
58-
59- if ( config . loadNavbar === true ) {
60- config . loadNavbar = '_navbar' + config . ext
61- }
62-
63- if ( config . coverpage === true ) {
64- config . coverpage = '_coverpage' + config . ext
65- }
66-
67- if ( config . repo === true ) {
68- config . repo = ''
69- }
70-
71- if ( config . name === true ) {
72- config . name = ''
73- }
58+ if ( config . loadSidebar === true ) {
59+ config . loadSidebar = '_sidebar' + config . ext
60+ }
61+ if ( config . loadNavbar === true ) {
62+ config . loadNavbar = '_navbar' + config . ext
63+ }
64+ if ( config . coverpage === true ) {
65+ config . coverpage = '_coverpage' + config . ext
66+ }
67+ if ( config . repo === true ) {
68+ config . repo = ''
69+ }
70+ if ( config . name === true ) {
71+ config . name = ''
7472 }
7573
7674 window . $docsify = config
0 commit comments