-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added scully mode detection. (in scully/from generated) * replaces require with custom one, and added node's global to context * remove stray blog sample
- Loading branch information
1 parent
4d5b46a
commit 1e558e0
Showing
6 changed files
with
39 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
const {configValidator} = require('../scully/bin'); | ||
|
||
console.log(__dirname) | ||
|
||
exports.extraRoutesPlugin = (route, options) => { | ||
const {createPath} = routeSplit(route); | ||
if (options.numberOfPages) { | ||
return Array.from({length: options.numberOfPages}, (_v, k) => k).map(n => ({ | ||
route: `${createPath(`${n}`)}`, | ||
title: `page number ${n}`, | ||
})); | ||
} | ||
if (options.data) { | ||
return options.data.map(item => ({ | ||
route: createPath(item.data), | ||
title: item.title || '', | ||
})); | ||
} | ||
return []; | ||
}; | ||
/** the validator is mandatory */ | ||
exports.extraRoutesPlugin[configValidator] = async options => []; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters