Skip to content

Instantly share code, notes, and snippets.

@MasonM
Created April 17, 2019 01:45
Show Gist options
  • Save MasonM/a8d2d00e502eafe582d1b966b74e2c02 to your computer and use it in GitHub Desktop.
Save MasonM/a8d2d00e502eafe582d1b966b74e2c02 to your computer and use it in GitHub Desktop.
Example plugin to override index page
module.exports = {
name() { return 'test_plugin' },
open(context) { this.make = context.messageMaker('test_plugin').make },
processMessage(message, queue) {
if (message.type === 'sitespeedio.setup') {
queue.postMessage(this.make('html.pug', {
id: 'index',
name: 'Overridden index',
pug: "html\n body\n h1 Hello!",
type: 'summary',
}));
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment