diff --git a/CHANGELOG.md b/CHANGELOG.md index 89ddc6422..84dd3d19a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +3.0.1 / 2017-02-19 +================== + + * fix(route): empty alias + 3.0.0 / 2017-02-19 ================== diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 768addec4..45bc9f63f 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_media/icon.svg) -# docsify 2.4.3 +# docsify 3.0 > A magical documentation site generator. diff --git a/docs/index.html b/docs/index.html index d4632d2e8..42f8bce64 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,6 +26,7 @@ auto2top: true, coverpage: true, loadSidebar: true, + executeScript: true, alias: { '/zh-cn/changelog': '/changelog', '/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG' diff --git a/lib/docsify.js b/lib/docsify.js index c6be9cdc3..8a9610253 100644 --- a/lib/docsify.js +++ b/lib/docsify.js @@ -3258,7 +3258,7 @@ function routeMixin (proto) { var config = ref.config; var base = getBasePath(config.basePath); - path = getAlias(path, config.alias); + path = config.alias ? getAlias(path, config.alias) : path; path = getFileName(path); path = path === '/README.md' ? (config.homepage || path) : path; path = isAbsolutePath(path) ? path : getPath(base, path); diff --git a/lib/docsify.min.js b/lib/docsify.min.js index aef616f08..112fc6c3d 100644 --- a/lib/docsify.min.js +++ b/lib/docsify.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";function e(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}function t(e){return"string"==typeof e||"number"==typeof e}function n(){}function r(e){return"function"==typeof e}function i(e){var t=["init","mounted","beforeEach","afterEach","doneEach","ready"];e._hooks={},e._lifecycle={},t.forEach(function(t){var n=e._hooks[t]=[];e._lifecycle[t]=function(e){return n.push(e)}})}function a(e,t,r,i){void 0===i&&(i=n);var a=r,o=e._hooks[t],s=function(e){var t=o[e];if(e>=o.length)i(a);else if("function"==typeof t)if(2===t.length)t(r,function(t){a=t,s(e+1)});else{var n=t(r);a=void 0!==n?n:a,s(e+1)}else s(e+1)};s(0)}function o(e,t){return void 0===t&&(t=!1),"string"==typeof e&&(e=t?s(e):de[e]||s(e)),e}function s(e,t){return t?e.querySelector(t):fe.querySelector(e)}function l(e,t){return[].slice.call(t?e.querySelectorAll(t):fe.querySelectorAll(e))}function u(e,t){return e=fe.createElement(e),t&&(e.innerHTML=t),e}function c(e,t){return e.appendChild(t)}function p(e,t){return e.insertBefore(t,e.children[0])}function h(e,t,n){r(t)?window.addEventListener(e,t):e.addEventListener(t,n)}function g(e,t,n){e&&e.classList[n?t:"toggle"](n||t)}function d(e){var t={};return(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(function(e){var n=e.replace(/\+/g," ").split("=");t[n[0]]=_e(n[1])}),t):t}function f(e){var t=[];for(var n in e)t.push((Le(n)+"="+Le(e[n])).toLowerCase());return t.length?"?"+t.join("&"):""}function m(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Ee(e.join("/"))}function v(e){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+e)}function b(){var e=y();return e=Te(e),"/"===e.charAt(0)?v(e):void v("/"+e)}function y(){var e=window.location.href,t=e.indexOf("#");return t===-1?"":e.slice(t+1)}function k(e){void 0===e&&(e=window.location.href);var t="",n=e.indexOf("?");n>=0&&(t=e.slice(n+1),e=e.slice(0,n));var r=e.indexOf("#");return r&&(e=e.slice(r+1)),{path:e,query:d(t)}}function w(e,t){var n=k(Te(e));return n.query=se({},n.query,t),e=n.path+f(n.query),Ee("#/"+e)}function x(e){var t=function(){return me.classList.toggle("close")};if(e=o(e),h(e,"click",t),xe){var n=o(".sidebar");h(n,"click",function(){t(),setTimeout(function(){return L(n,!0,!0)},0)})}}function _(){var e=o("section.cover");if(e){var t=e.getBoundingClientRect().height;window.pageYOffset>=t||e.classList.contains("hidden")?g(me,"add","sticky"):g(me,"remove","sticky")}}function L(e,t,n){e=o(e);var r,i=l(e,"a"),a="#"+y();return i.sort(function(e,t){return t.href.length-e.href.length}).forEach(function(e){var n=e.getAttribute("href"),i=t?e.parentNode:e;0!==a.indexOf(n)||r?g(i,"remove","active"):(r=e,g(i,"add","active"))}),n&&(fe.title=r?r.innerText+" - "+je:je),r}function S(){function e(){for(var e,o=me.scrollTop,s=0,l=n.length;so){e||(e=c);break}e=c}if(e){var p=a[e.getAttribute("data-id")];if(p&&p!==u&&(u&&u.classList.remove("active"),p.classList.add("active"),u=p,!t&&me.classList.contains("sticky"))){var h=r.clientHeight,g=0,d=u.offsetTop+u.clientHeight+40,f=u.offsetTop>=i.scrollTop&&d<=i.scrollTop+h,m=d-g=400?a(n):(qe[e]=n.response,r(n.response))})},abort:function(e){return 4!==r.readyState&&r.abort()}})}function A(e,t){e.innerHTML=e.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,t)}function j(e){return e?(/\/\//.test(e)||(e="https://github.com/"+e),e=e.replace(/^git\+/,""),'`'):""}function M(e){var t='';return(xe?t+"
":"
"+t)+'
'}function O(){var e=", 100%, 85%",t="linear-gradient(to left bottom, hsl("+(Math.floor(255*Math.random())+e)+") 0%,hsl("+(Math.floor(255*Math.random())+e)+") 100%)";return'
'}function q(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+='
  • '+e.title+"
  • ",e.children&&(t+='
    • '+q(e.children)+"
    ")}),t):""}function P(e,t){return'

    '+t.slice(5).trim()+"

    "}function N(e){return""}function F(e,t){return t={exports:{}},e(t,t.exports),t.exports}function I(e,t){var n=[],r={};return e.forEach(function(e){var i=e.level||1,a=i-1;i>t||(r[a]?(r[a].children=r[a].children||[],r[a].children.push(e)):n.push(e),r[i]=e)}),n}function H(e){if("string"!=typeof e)return"";var t=e.toLowerCase().trim().replace(/<[^>\d]+>/g,"").replace(Re,"").replace(/\s/g,"-").replace(/-+/g,"-").replace(/^(\d)/,"_$1"),n=ze[t];return n=ze.hasOwnProperty(t)?n+1:0,ze[t]=n,n&&(t=t+"-"+n),t}function z(){ze={}}function R(e){return e.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g,function(e){return e.replace(/:/g,"__colon__")}).replace(/:(\w+?):/gi,'$1').replace(/__colon__/g,":")}function W(e,t){var n="";if(e)n=Ve(e),n=n.match(/]*>([\s\S]+)<\/ul>/g)[0];else{var r=I(Ze,t);n=q(r,"