This is the source for the Nuxt.js based demo site deployed to Netlify, that includes the use of plugins I've created for the Netlify Plugin Directory
The Algolia Export plugin exports the parsed built pages to Algolia directly. Requires environment variables to be set to work, without which it will fail the plugin but not the build, with a message reminding you to set them.
[[plugins]]
package = "netlify-plugin-algolia-export"
[plugins.inputs]
exclude = ['/private', '/200', '/search']
The OpenSearch plugin builds a simple search.xml file based on config. Why not just create a search.xml
file? It is just another arbitrary file to store statically.
[[plugins]]
package = "netlify-plugin-opensearch"
[plugins.inputs]
siteShortName = "Demo Site"
siteDescription = "Find stuff on the demo site"
siteTags = "demos"
siteContact = "luke@lukeoliff.com"
Install and run :)
npm install
npm run dev
Using this as an Algolia enabled Nuxt.js Starter repo, see above for running locally.
To build as a universal server-side rendered Vue application:
npm run generate
Dist folder is the standard Nuxt.js dist
directory.
The Algolia Export plugin requires the following environment variables.
env variable name | type | required | default | description |
---|---|---|---|---|
ALGOLIA_APPLICATION_ID | String | true | null |
Your Algolia application ID |
ALGOLIA_ADMIN_KEY | String | true | null |
Your Algolia Admin (or any index-write enabled) API key |
ALGOLIA_INDEX | String | true | null |
Your Algolia index name |
The /search
page uses Algolia InstantSearch. You'll need to add an extra environment variable to get this working.
env variable name | type | required | default | description |
---|---|---|---|---|
ALGOLIA_SEARCH_KEY | String | true | null |
Your Algolia Search (or any index-read enabled) API key |
Make pull-requests, but follow code of conduct please.