Skip to content

Commit

Permalink
Merge pull request #5 from reod/reod-patch-1
Browse files Browse the repository at this point in the history
Update example in README
  • Loading branch information
reod authored Apr 25, 2019
2 parents d8b7787 + 73f470e commit 7abb7fe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ const app = new Koa();
app
.use(koaHead())
.use(async (ctx, next) => {
ctx.document.setTitle('Title for my webpage');
ctx.document.addMetaTag({ name: 'twitter:card', content: 'summary_large_image' });
ctx.document.addLink({ rel: 'canonical', href: 'index.html' });
ctx.document.addStyle('body { background: aliceblue; }');
ctx.document.addScript("{ fixture: 'test fixture' }");
ctx.documentHead.setTitle('Title for my webpage');
ctx.documentHead.addMetaTag({ name: 'twitter:card', content: 'summary_large_image' });
ctx.documentHead.addLink({ rel: 'canonical', href: 'index.html' });
ctx.documentHead.addStyle('body { background: aliceblue; }');
ctx.documentHead.addScript("{ fixture: 'test fixture' }");

await next();
})
.use(ctx => {
const documentHead = ctx.document.toHTML();
const documentHead = ctx.documentHead.toHTML();
const userData = { name: 'John Doe' };

await ctx.myAwesomeLayoutEngine('user-view', {
Expand Down

0 comments on commit 7abb7fe

Please sign in to comment.