fix(static): file path
This commit is contained in:
parent
d9d9d114f4
commit
082c68ecee
7 changed files with 151 additions and 160 deletions
|
|
@ -1,7 +1,6 @@
|
|||
(function () {
|
||||
var INDEXS = {};
|
||||
|
||||
<<<<<<< HEAD
|
||||
var LOCAL_STORAGE = {
|
||||
EXPIRE_KEY: 'docsify.search.expires',
|
||||
INDEX_KEY: 'docsify.search.index'
|
||||
|
|
@ -14,8 +13,6 @@ function resolveIndexKey(namespace) {
|
|||
return namespace ? ((LOCAL_STORAGE.INDEX_KEY) + "/" + namespace) : LOCAL_STORAGE.INDEX_KEY
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> [build] 4.8.6
|
||||
function escapeHtml(string) {
|
||||
var entityMap = {
|
||||
'&': '&',
|
||||
|
|
@ -49,15 +46,9 @@ function getAllPaths(router) {
|
|||
return paths
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
function saveData(maxAge, expireKey, indexKey) {
|
||||
localStorage.setItem(expireKey, Date.now() + maxAge);
|
||||
localStorage.setItem(indexKey, JSON.stringify(INDEXS));
|
||||
=======
|
||||
function saveData(maxAge) {
|
||||
localStorage.setItem('docsify.search.expires', Date.now() + maxAge);
|
||||
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS));
|
||||
>>>>>>> [build] 4.8.6
|
||||
}
|
||||
|
||||
function genIndex(path, content, router, depth) {
|
||||
|
|
@ -175,7 +166,6 @@ function search(query) {
|
|||
|
||||
function init$1(config, vm) {
|
||||
var isAuto = config.paths === 'auto';
|
||||
<<<<<<< HEAD
|
||||
|
||||
var expireKey = resolveExpireKey(config.namespace);
|
||||
var indexKey = resolveIndexKey(config.namespace);
|
||||
|
|
@ -183,11 +173,6 @@ function init$1(config, vm) {
|
|||
var isExpired = localStorage.getItem(expireKey) < Date.now();
|
||||
|
||||
INDEXS = JSON.parse(localStorage.getItem(indexKey));
|
||||
=======
|
||||
var isExpired = localStorage.getItem('docsify.search.expires') < Date.now();
|
||||
|
||||
INDEXS = JSON.parse(localStorage.getItem('docsify.search.index'));
|
||||
>>>>>>> [build] 4.8.6
|
||||
|
||||
if (isExpired) {
|
||||
INDEXS = {};
|
||||
|
|
@ -208,11 +193,7 @@ function init$1(config, vm) {
|
|||
.get(vm.router.getFile(path), false, vm.config.requestHeaders)
|
||||
.then(function (result) {
|
||||
INDEXS[path] = genIndex(path, result, vm.router, config.depth);
|
||||
<<<<<<< HEAD
|
||||
len === ++count && saveData(config.maxAge, expireKey, indexKey);
|
||||
=======
|
||||
len === ++count && saveData(config.maxAge);
|
||||
>>>>>>> [build] 4.8.6
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -346,12 +327,8 @@ var CONFIG = {
|
|||
paths: 'auto',
|
||||
depth: 2,
|
||||
maxAge: 86400000, // 1 day
|
||||
<<<<<<< HEAD
|
||||
hideOtherSidebarContent: false,
|
||||
namespace: undefined
|
||||
=======
|
||||
hideOtherSidebarContent: false
|
||||
>>>>>>> [build] 4.8.6
|
||||
};
|
||||
|
||||
var install = function (hook, vm) {
|
||||
|
|
@ -367,10 +344,7 @@ var install = function (hook, vm) {
|
|||
CONFIG.noData = opts.noData || CONFIG.noData;
|
||||
CONFIG.depth = opts.depth || CONFIG.depth;
|
||||
CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent;
|
||||
<<<<<<< HEAD
|
||||
CONFIG.namespace = opts.namespace || CONFIG.namespace;
|
||||
=======
|
||||
>>>>>>> [build] 4.8.6
|
||||
}
|
||||
|
||||
var isAuto = CONFIG.paths === 'auto';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue