mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
a98efe1b68
closes #2217 - This helper has been deprecated in favour of `page_url` for more than 2 years!!! - Ghost 1.0.0 is the end of all of this 💩
23 lines
534 B
JavaScript
23 lines
534 B
JavaScript
// ### Page URL Helper
|
|
//
|
|
// *Usage example:*
|
|
// `{{page_url 2}}`
|
|
//
|
|
// Returns the URL for the page specified in the current object
|
|
// context.
|
|
//
|
|
// We use the name page_url to match the helper for consistency:
|
|
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
|
|
var getPaginatedUrl = require('../data/meta/paginated_url'),
|
|
page_url;
|
|
|
|
page_url = function (page, options) {
|
|
if (!options) {
|
|
options = page;
|
|
page = 1;
|
|
}
|
|
return getPaginatedUrl(page, options.data.root);
|
|
};
|
|
|
|
module.exports = page_url;
|