Created
April 17, 2019 01:45
-
-
Save MasonM/a8d2d00e502eafe582d1b966b74e2c02 to your computer and use it in GitHub Desktop.
Example plugin to override index page
This file contains hidden or 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
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