hikaru-coffee
Advanced tools
Comparing version 1.2.3 to 1.3.0
// Generated by CoffeeScript 2.3.1 | ||
(function() { | ||
var Generator, Hikaru, Logger, Renderer, Router, Translator, URL, cheerio, coffee, dateStrCompare, escapeHTML, fse, getAbsPathFn, getURLFn, glob, highlight, marked, moment, nib, nunjucks, paginate, paginateCategories, path, removeControlChars, sortCategories, stylus, yaml; | ||
var Generator, Hikaru, Logger, Renderer, Router, Translator, URL, cheerio, coffee, dateStrCompare, escapeHTML, fse, getAbsPathFn, getUrlFn, glob, highlight, marked, moment, nib, nunjucks, paginate, paginateCategories, path, removeControlChars, sortCategories, stylus, yaml; | ||
@@ -41,3 +41,3 @@ fse = require("fs-extra"); | ||
({escapeHTML, removeControlChars, paginate, dateStrCompare, sortCategories, paginateCategories, getAbsPathFn, getURLFn} = require("./utils")); | ||
({escapeHTML, removeControlChars, paginate, dateStrCompare, sortCategories, paginateCategories, getAbsPathFn, getUrlFn} = require("./utils")); | ||
@@ -291,3 +291,3 @@ module.exports = Hikaru = class Hikaru { | ||
return this.generator.register(["post", "page"], (page, posts, ctx) => { | ||
var $, a, getURL, h, hNames, headings, href, i, imgs, j, l, len, len1, len2, level, links, m, split, src, toc; | ||
var $, a, getUrl, h, hNames, headings, href, i, imgs, j, l, len, len1, len2, level, links, m, split, src, toc; | ||
$ = cheerio.load(page["content"]); | ||
@@ -312,3 +312,3 @@ // TOC generate. | ||
// Replace relative path to absolute path. | ||
getURL = getURLFn(this.site["siteConfig"]["baseURL"], this.site["siteConfig"]["rootDir"]); | ||
getUrl = getUrlFn(this.site["siteConfig"]["baseUrl"], this.site["siteConfig"]["rootDir"]); | ||
links = $("a"); | ||
@@ -318,3 +318,3 @@ for (l = 0, len1 = links.length; l < len1; l++) { | ||
href = $(a).attr("href"); | ||
if (new URL(href, this.site["siteConfig"]["baseURL"]).host !== getURL().host) { | ||
if (new URL(href, this.site["siteConfig"]["baseUrl"]).host !== getUrl().host) { | ||
$(a).attr("target", "_blank"); | ||
@@ -510,3 +510,3 @@ } | ||
"removeControlChars": removeControlChars, | ||
"getURL": getURLFn(site["siteConfig"]["baseURL"], site["siteConfig"]["rootDir"]), | ||
"getUrl": getUrlFn(site["siteConfig"]["baseUrl"], site["siteConfig"]["rootDir"]), | ||
"getAbsPath": getAbsPathFn(site["siteConfig"]["rootDir"]) | ||
@@ -513,0 +513,0 @@ }); |
// Generated by CoffeeScript 2.3.1 | ||
(function() { | ||
var Router, dateStrCompare, fm, fse, getAbsPathFn, getURLFn, glob, isCurrentPathFn, moment, path, yaml; | ||
var Router, dateStrCompare, fm, fse, getAbsPathFn, getUrlFn, glob, isCurrentPathFn, moment, path, yaml; | ||
@@ -17,3 +17,3 @@ path = require("path"); | ||
({dateStrCompare, getAbsPathFn, getURLFn, isCurrentPathFn} = require("./utils")); | ||
({dateStrCompare, getAbsPathFn, getUrlFn, isCurrentPathFn} = require("./utils")); | ||
@@ -50,3 +50,3 @@ module.exports = Router = class Router { | ||
}; | ||
this.getURL = getURLFn(this.site["siteConfig"]["baseURL"], this.site["siteConfig"]["rootDir"]); | ||
this.getUrl = getUrlFn(this.site["siteConfig"]["baseUrl"], this.site["siteConfig"]["rootDir"]); | ||
this.getAbsPath = getAbsPathFn(this.site["siteConfig"]["rootDir"]); | ||
@@ -203,3 +203,3 @@ } | ||
"moment": moment, | ||
"getURL": this.getURL, | ||
"getUrl": this.getUrl, | ||
"getAbsPath": this.getAbsPath, | ||
@@ -206,0 +206,0 @@ "isCurrentPath": isCurrentPathFn(this.site["siteConfig"]["rootDir"], p["docPath"]), |
// Generated by CoffeeScript 2.3.1 | ||
(function() { | ||
var URL, dateStrCompare, escapeHTML, getAbsPathFn, getURLFn, isCurrentPathFn, paginate, paginateCategories, path, removeControlChars, sortCategories; | ||
var URL, dateStrCompare, escapeHTML, getAbsPathFn, getUrlFn, isCurrentPathFn, paginate, paginateCategories, path, removeControlChars, sortCategories; | ||
@@ -98,7 +98,7 @@ path = require("path"); | ||
getURLFn = function(baseURL, rootDir = path.posix.sep) { | ||
getUrlFn = function(baseUrl, rootDir = path.posix.sep) { | ||
var getAbsPath; | ||
getAbsPath = getAbsPathFn(rootDir); | ||
return function(docPath = "") { | ||
return new URL(getAbsPath(docPath), baseURL); | ||
return new URL(getAbsPath(docPath), baseUrl); | ||
}; | ||
@@ -140,3 +140,3 @@ }; | ||
"getAbsPathFn": getAbsPathFn, | ||
"getURLFn": getURLFn, | ||
"getUrlFn": getUrlFn, | ||
"isCurrentPathFn": isCurrentPathFn | ||
@@ -143,0 +143,0 @@ }; |
{ | ||
"name": "hikaru-coffee", | ||
"version": "1.2.3", | ||
"version": "1.3.0", | ||
"description": "A static site generator that generates routes based on directories naturally.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet