Automatically crawl and store metadata about your Nuxt generated pages into your Algolia index. Should work with Nuxt 2, Nuxt Bridge & Nuxt 3 ๐ฅ.
yarn add @yassidev/nuxt-crawler -D
# npm i @yassidev/nuxt-crawler -D
Within your nuxt.config
add the following:
// nuxt.config
export default {
buildModules: [
'@yassidev/nuxt-crawler'
],
crawler: {
fields?: ((route: string, html: string, meta: MetaData) => Partial<MetaData>) | (keyof MetaData)[], // default: ['title', 'description']
include?: ((route: string) => boolean) | (string | RegExp)[], // default: undefined
apiKey: string, // required
apiAdminKey: string, // required
appId: string, // required
indexName: string // required
}
}
ForTypescript support, add the module within your tsconfig.json
:
{
"compilerOptions": {
"types": [
"@yassidev/nuxt-crawler"
]
}
}
"compilerOptions": {