Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to read config data packe first #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tasks/html_sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ module.exports = function(grunt) {

// Register our task
grunt.registerMultiTask('html_sitemap', 'Create HTML sitemaps from a directory.', function() {
// Read package.json
const pkg = grunt.config.data.pkg || grunt.file.readJSON('package.json')

// Merge task-specific and/or target-specific options with these defaults.
var taskOpts = this.options({
siteBase: JSON.parse(grunt.file.read('package.json')).homepage,
siteBase: pkg.homepage,
separator: false,
searchPath: '',
template: false,
Expand Down Expand Up @@ -98,7 +101,7 @@ module.exports = function(grunt) {
}
});


// Get unique destinations and write to them
var destinations = _.uniq(outFiles, function(file) {
if (taskOpts.template) {
Expand Down