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

resolve-media-map #179

Merged
merged 3 commits into from
Nov 30, 2015
Merged

resolve-media-map #179

merged 3 commits into from
Nov 30, 2015

Conversation

TakenPilot
Copy link
Contributor

New Feature

  • Allow sites to modify the media map used within a template.

For example

module.exports = function (router, composer) {

  router.get('/', composer);
  router.get('/:year/:month/:name', composer);

  return router;
};

module.exports.resolveMedia = function (media, locals) {
  const assetPath = locals.site.assetPath;

  if (locals.edit) {
    media.scripts = [assetPath + '/js/edit-before.js'];
  } else {
    media.scripts.unshift(assetPath + '/js/view-before.js');
    media.scripts.push(assetPath + '/js/view-after.js');
  }
};

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 99.819% when pulling b555e17 on resolve-media-map into 3ebd9b3 on master.

@TakenPilot
Copy link
Contributor Author

I'll be putting coverage at a pure 100% this PR as well, I guess. It's time, after all.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 100.0% when pulling 8342ac8 on resolve-media-map into 3ebd9b3 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 100.0% when pulling 2d0c7a3 on resolve-media-map into 3ebd9b3 on master.

@techmsi
Copy link

techmsi commented Nov 30, 2015

+1

TakenPilot added a commit that referenced this pull request Nov 30, 2015
@TakenPilot TakenPilot merged commit 47cee1b into master Nov 30, 2015
@TakenPilot TakenPilot deleted the resolve-media-map branch November 30, 2015 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants