metalsmith-sitemap
Advanced tools
Comparing version 0.0.4 to 0.0.5
var fs = require('fs'), | ||
Handlebars = require('handlebars'), | ||
_ = require('lodash'), | ||
toFn = require('to-function'), | ||
url = require('url'), | ||
defaultsDeep = _.partialRight(_.merge, function deep(value, other) { | ||
return _.merge(value, other, deep); | ||
}), | ||
resolve = function(object, property) { | ||
return _.reduce(property.split('.'), function(o, p) { | ||
return o ? o[p] : undefined; | ||
}, object); | ||
}; | ||
}); | ||
@@ -19,2 +15,5 @@ module.exports = plugin; | ||
var getUrl = toFn(options.urlProperty), | ||
getModified = toFn(options.modifiedProperty); | ||
var templatesDir = __dirname + '/templates'; | ||
@@ -58,4 +57,4 @@ | ||
entry = _.defaults({ | ||
loc: url.resolve(options.hostname, resolve(data, options.urlProperty)), | ||
lastmod: resolve(data, options.modifiedProperty), | ||
loc: url.resolve(options.hostname, getUrl(data)), | ||
lastmod: getModified(data), | ||
changefreq: data.sitemap.changefreq, | ||
@@ -62,0 +61,0 @@ priority: data.sitemap.priority |
{ | ||
"name": "metalsmith-sitemap", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A metalsmith plugin for generating a sitemap.xml file.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6898
67