saberland/saber

Invoke a hook before/after generating a page #89

egoist posted onGitHub

<!-- Please don't delete this template or we'll close your issue -->

<!-- Before creating an issue please make sure you are using the latest version of Saber. -->

Feature request

<!-- Please ask questions via following several ways. -->

<!-- https://chat.saber.land/ -->

<!-- https://stackoverflow.com/questions/ask?tags=saberjs -->

What problem does this feature solve?

Would be useful for https://github.com/egoist/saber/issues/71

What does the proposed API look like?

api.hooks.afterGeneratePage.tapPromise(ID, context => {
  const amp = shouldGenerateAMPPage(context)
  if (amp) {
    //...
  }
})

How should this be implemented in your opinion?

N/A

Are you willing to work on this yourself?

PR welcome.


Fund this Issue

$20.00
Rewarded

Rewarded pull request

Recent activities

marchworks was rewarded by egoist for egoist/saber# 89
almost 6 years ago
marchworks submitted an output to  egoist/ saber# 89
almost 6 years ago