Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions src/core/config.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
import {merge, hyphenate, isPrimitive, hasOwn} from './util/core'

const currentScript = document.currentScript

export default function () {
const config = merge(
{
Expand DownExpand Up@@ -36,7 +38,7 @@ export default function () {
)

const script =
document.currentScript ||
currentScript ||
[].slice
.call(document.getElementsByTagName('script'))
.filter(n => /docsify\./.test(n.src))[0]
Expand All@@ -51,26 +53,22 @@ export default function () {
}
}
}
}

if (config.loadSidebar === true) {
config.loadSidebar = '_sidebar' + config.ext
}

if (config.loadNavbar === true) {
config.loadNavbar = '_navbar' + config.ext
}

if (config.coverpage === true) {
config.coverpage = '_coverpage' + config.ext
}

if (config.repo === true) {
config.repo = ''
}

if (config.name === true) {
config.name = ''
}
if (config.loadSidebar === true) {
config.loadSidebar = '_sidebar' + config.ext
}
if (config.loadNavbar === true) {
config.loadNavbar = '_navbar' + config.ext
}
if (config.coverpage === true) {
config.coverpage = '_coverpage' + config.ext
}
if (config.repo === true) {
config.repo = ''
}
if (config.name === true) {
config.name = ''
}

window.$docsify = config
Expand Down