Skip to content

Instantly share code, notes, and snippets.

@leesei
Created March 1, 2016 08:55
Show Gist options
  • Save leesei/2eff3a6d899f76dbf2e6 to your computer and use it in GitHub Desktop.
Save leesei/2eff3a6d899f76dbf2e6 to your computer and use it in GitHub Desktop.
hexo #1788
==================== fix ====================
config.root = "/";
url_for("#") ==> "#"
url_for("#top") ==> "#top"
url_for("http://www.google.com") ==> "http://www.google.com"
url_for("https://www.google.com") ==> "https://www.google.com"
url_for("//www.google.com") ==> "//www.google.com"
url_for("/archives") ==> "/archives"
url_for(" /archives ") ==> "/archives"
url_for("2016/03/01") ==> "/2016/03/01"
url_for("2016/03/01/index.html") ==> "/2016/03/01/index.html"
url_for("./x/y/z/index.html") ==> "/./x/y/z/index.html"
url_for("../x/y/z/index.html") ==> "/../x/y/z/index.html"
url_for("../../x/y/z/index.html") ==> "/../../x/y/z/index.html"
config.root = "/a/b/c";
url_for("#") ==> "#"
url_for("#top") ==> "#top"
url_for("http://www.google.com") ==> "http://www.google.com"
url_for("https://www.google.com") ==> "https://www.google.com"
url_for("//www.google.com") ==> "//www.google.com"
url_for("/archives") ==> "/archives"
url_for(" /archives ") ==> "/archives"
url_for("2016/03/01") ==> "/a/b/c/2016/03/01"
url_for("2016/03/01/index.html") ==> "/a/b/c/2016/03/01/index.html"
url_for("./x/y/z/index.html") ==> "/a/b/c/./x/y/z/index.html"
url_for("../x/y/z/index.html") ==> "/a/b/c/../x/y/z/index.html"
url_for("../../x/y/z/index.html") ==> "/a/b/c/../../x/y/z/index.html"
config.root = "/a/b/c/";
url_for("#") ==> "#"
url_for("#top") ==> "#top"
url_for("http://www.google.com") ==> "http://www.google.com"
url_for("https://www.google.com") ==> "https://www.google.com"
url_for("//www.google.com") ==> "//www.google.com"
url_for("/archives") ==> "/archives"
url_for(" /archives ") ==> "/archives"
url_for("2016/03/01") ==> "/a/b/c/2016/03/01"
url_for("2016/03/01/index.html") ==> "/a/b/c/2016/03/01/index.html"
url_for("./x/y/z/index.html") ==> "/a/b/c/./x/y/z/index.html"
url_for("../x/y/z/index.html") ==> "/a/b/c/../x/y/z/index.html"
url_for("../../x/y/z/index.html") ==> "/a/b/c/../../x/y/z/index.html"
config.root = null;
url_for("#") ==> "#"
url_for("#top") ==> "#top"
url_for("http://www.google.com") ==> "http://www.google.com"
url_for("https://www.google.com") ==> "https://www.google.com"
url_for("//www.google.com") ==> "//www.google.com"
url_for("/archives") ==> "/archives"
url_for(" /archives ") ==> "/archives"
url_for("2016/03/01") ==> "/2016/03/01"
url_for("2016/03/01/index.html") ==> "/2016/03/01/index.html"
url_for("./x/y/z/index.html") ==> "/./x/y/z/index.html"
url_for("../x/y/z/index.html") ==> "/../x/y/z/index.html"
url_for("../../x/y/z/index.html") ==> "/../../x/y/z/index.html"
==================== 3.2.0 ====================
config.root = "/";
url_for("#") ==> "#"
url_for("#top") ==> "#top"
url_for("http://www.google.com") ==> "http://www.google.com"
url_for("https://www.google.com") ==> "https://www.google.com"
url_for("//www.google.com") ==> "//www.google.com"
url_for("/archives") ==> "/archives"
url_for(" /archives ") ==> "/ /archives "
url_for("2016/03/01") ==> "/2016/03/01"
url_for("2016/03/01/index.html") ==> "/2016/03/01/index.html"
url_for("./x/y/z/index.html") ==> "/./x/y/z/index.html"
url_for("../x/y/z/index.html") ==> "/../x/y/z/index.html"
url_for("../../x/y/z/index.html") ==> "/../../x/y/z/index.html"
config.root = "/a/b/c";
url_for("#") ==> "#"
url_for("#top") ==> "#top"
url_for("http://www.google.com") ==> "http://www.google.com"
url_for("https://www.google.com") ==> "https://www.google.com"
url_for("//www.google.com") ==> "//www.google.com"
url_for("/archives") ==> "/a/b/c/archives"
url_for(" /archives ") ==> "/a/b/c /archives "
url_for("2016/03/01") ==> "/a/b/c2016/03/01"
url_for("2016/03/01/index.html") ==> "/a/b/c2016/03/01/index.html"
url_for("./x/y/z/index.html") ==> "/a/b/c./x/y/z/index.html"
url_for("../x/y/z/index.html") ==> "/a/b/c../x/y/z/index.html"
url_for("../../x/y/z/index.html") ==> "/a/b/c../../x/y/z/index.html"
config.root = "/a/b/c/";
url_for("#") ==> "#"
url_for("#top") ==> "#top"
url_for("http://www.google.com") ==> "http://www.google.com"
url_for("https://www.google.com") ==> "https://www.google.com"
url_for("//www.google.com") ==> "//www.google.com"
url_for("/archives") ==> "/a/b/c/archives"
url_for(" /archives ") ==> "/a/b/c/ /archives "
url_for("2016/03/01") ==> "/a/b/c/2016/03/01"
url_for("2016/03/01/index.html") ==> "/a/b/c/2016/03/01/index.html"
url_for("./x/y/z/index.html") ==> "/a/b/c/./x/y/z/index.html"
url_for("../x/y/z/index.html") ==> "/a/b/c/../x/y/z/index.html"
url_for("../../x/y/z/index.html") ==> "/a/b/c/../../x/y/z/index.html"
config.root = null;
url_for("#") ==> "#"
url_for("#top") ==> "#top"
url_for("http://www.google.com") ==> "http://www.google.com"
url_for("https://www.google.com") ==> "https://www.google.com"
url_for("//www.google.com") ==> "//www.google.com"
url_for("/archives") ==> "null/archives"
url_for(" /archives ") ==> "null /archives "
url_for("2016/03/01") ==> "null2016/03/01"
url_for("2016/03/01/index.html") ==> "null2016/03/01/index.html"
url_for("./x/y/z/index.html") ==> "null./x/y/z/index.html"
url_for("../x/y/z/index.html") ==> "null../x/y/z/index.html"
url_for("../../x/y/z/index.html") ==> "null../../x/y/z/index.html"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment