Skip to content

Commit

Permalink
chore: add content:ready hook (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac authored Jul 9, 2020
1 parent e1d12c7 commit 6fe516f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ module.exports = async function (moduleOptions) {

return database.query(`/${path}`, options)
}
$content.database = database
module.exports.$content = $content

// Call content:ready hook
await this.nuxt.callHook('content:ready', $content)

// Add $content reference to ssrContext
this.nuxt.hook('vue-renderer:context', (ssrContext) => {
ssrContext.$content = $content
Expand Down

0 comments on commit 6fe516f

Please sign in to comment.