Skip to content

Commit

Permalink
Merge pull request #156 from geekguy/master
Browse files Browse the repository at this point in the history
update readme as per #114
  • Loading branch information
Atinux committed Nov 10, 2017
2 parents 00444d0 + 35d4bb1 commit 5acf4cb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,17 @@ app.get('*', (req, res) => {
})
```

If you are using a separate template file, edit your head tag with

```html
<head>
{{{ meta.inject().title.text() }}}
{{{ meta.inject().meta.text() }}}
</head>
```

Notice the use of `{{{` to avoid double escaping. Be extremely cautious when you use `{{{` with `__dangerouslyDisableSanitizers`.

#### Streaming Rendering with `renderToStream()`

A little more complex, but well worth it, is to instead stream your response. `vue-meta` supports streaming with no effort (on it's part :stuck_out_tongue_winking_eye:) thanks to Vue's clever `bundleRenderer` context injection:
Expand Down Expand Up @@ -677,7 +688,7 @@ Easy. Instead of defining `metaInfo` as an object, define it as a function and a
```html
<template>
<div>
<h1>{{ title }}</h1>
<h1>{{{ title }}}</h1>
</div>
</template>

Expand Down

0 comments on commit 5acf4cb

Please sign in to comment.