@@ -60,70 +60,74 @@ function isFn(obj) {
6060 return typeof obj === 'function'
6161}
6262
63- var config = merge (
64- {
65- el : '#app' ,
66- repo : '' ,
67- maxLevel : 6 ,
68- subMaxLevel : 0 ,
69- loadSidebar : null ,
70- loadNavbar : null ,
71- homepage : 'README.md' ,
72- coverpage : '' ,
73- basePath : '' ,
74- auto2top : false ,
75- name : '' ,
76- themeColor : '' ,
77- nameLink : window . location . pathname ,
78- autoHeader : false ,
79- executeScript : null ,
80- noEmoji : false ,
81- ga : '' ,
82- ext : '.md' ,
83- mergeNavbar : false ,
84- formatUpdated : '' ,
85- externalLinkTarget : '_blank' ,
86- routerMode : 'hash' ,
87- noCompileLinks : [ ]
88- } ,
89- window . $docsify
90- ) ;
63+ function config ( ) {
64+ var config = merge (
65+ {
66+ el : '#app' ,
67+ repo : '' ,
68+ maxLevel : 6 ,
69+ subMaxLevel : 0 ,
70+ loadSidebar : null ,
71+ loadNavbar : null ,
72+ homepage : 'README.md' ,
73+ coverpage : '' ,
74+ basePath : '' ,
75+ auto2top : false ,
76+ name : '' ,
77+ themeColor : '' ,
78+ nameLink : window . location . pathname ,
79+ autoHeader : false ,
80+ executeScript : null ,
81+ noEmoji : false ,
82+ ga : '' ,
83+ ext : '.md' ,
84+ mergeNavbar : false ,
85+ formatUpdated : '' ,
86+ externalLinkTarget : '_blank' ,
87+ routerMode : 'hash' ,
88+ noCompileLinks : [ ]
89+ } ,
90+ window . $docsify
91+ ) ;
9192
92- var script =
93- document . currentScript ||
94- [ ] . slice
95- . call ( document . getElementsByTagName ( 'script' ) )
96- . filter ( function ( n ) { return / d o c s i f y \. / . test ( n . src ) ; } ) [ 0 ] ;
93+ var script =
94+ document . currentScript ||
95+ [ ] . slice
96+ . call ( document . getElementsByTagName ( 'script' ) )
97+ . filter ( function ( n ) { return / d o c s i f y \. / . test ( n . src ) ; } ) [ 0 ] ;
9798
98- if ( script ) {
99- for ( var prop in config ) {
100- if ( hasOwn . call ( config , prop ) ) {
101- var val = script . getAttribute ( 'data-' + hyphenate ( prop ) ) ;
99+ if ( script ) {
100+ for ( var prop in config ) {
101+ if ( hasOwn . call ( config , prop ) ) {
102+ var val = script . getAttribute ( 'data-' + hyphenate ( prop ) ) ;
102103
103- if ( isPrimitive ( val ) ) {
104- config [ prop ] = val === '' ? true : val ;
104+ if ( isPrimitive ( val ) ) {
105+ config [ prop ] = val === '' ? true : val ;
106+ }
105107 }
106108 }
107- }
108109
109- if ( config . loadSidebar === true ) {
110- config . loadSidebar = '_sidebar' + config . ext ;
111- }
112- if ( config . loadNavbar === true ) {
113- config . loadNavbar = '_navbar' + config . ext ;
114- }
115- if ( config . coverpage === true ) {
116- config . coverpage = '_coverpage' + config . ext ;
117- }
118- if ( config . repo === true ) {
119- config . repo = '' ;
120- }
121- if ( config . name === true ) {
122- config . name = '' ;
110+ if ( config . loadSidebar === true ) {
111+ config . loadSidebar = '_sidebar' + config . ext ;
112+ }
113+ if ( config . loadNavbar === true ) {
114+ config . loadNavbar = '_navbar' + config . ext ;
115+ }
116+ if ( config . coverpage === true ) {
117+ config . coverpage = '_coverpage' + config . ext ;
118+ }
119+ if ( config . repo === true ) {
120+ config . repo = '' ;
121+ }
122+ if ( config . name === true ) {
123+ config . name = '' ;
124+ }
123125 }
124- }
125126
126- window . $docsify = config ;
127+ window . $docsify = config ;
128+
129+ return config
130+ }
127131
128132function initLifecycle ( vm ) {
129133 var hooks = [
@@ -4494,7 +4498,7 @@ function initFetch(vm) {
44944498function initMixin ( proto ) {
44954499 proto . _init = function ( ) {
44964500 var vm = this ;
4497- vm . config = config || { } ;
4501+ vm . config = config ( ) ;
44984502
44994503 initLifecycle ( vm ) ; // Init hooks
45004504 initPlugin ( vm ) ; // Install plugins
@@ -4573,7 +4577,7 @@ initGlobalAPI();
45734577/**
45744578 * Version
45754579 */
4576- Docsify . version = '4.6.9 ' ;
4580+ Docsify . version = '4.6.10 ' ;
45774581
45784582/**
45794583 * Run Docsify
0 commit comments