New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hexo-algolia

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-algolia

Index your content in Algolia Search API

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
129
decreased by-55.21%
Maintainers
2
Weekly downloads
 
Created
Source

hexo-algolia Build Status

Index content in Algolia Search API.

Install

Compatible with node>=4.0.0.

$ npm install --save hexo-algolia

Public Facing Search Options

You can configure the plugin in your hexo website _config.yml file:

algolia:
  applicationID: 'applicationID'
  apiKey: 'apiKey'
  indexName: '...'
  • applicationID - Your application Id
  • apiKey - Your API key (for read-only operation, like search)
  • indexName - The name of the Algolia index to use

You can access them from your hexo theme in order to instantiate the algolia client with the JavaScript client:

<script src="https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js"></script>
<script src="https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.min.js"></script>

<script>
var client = algoliasearch("<%- site.config.algolia.applicationID %>", "<%- site.config.algolia.apiKey %>");
var index = client.initIndex('<%- site.config.algolia.indexName %>');

// ...
</script>

Indexing Content

Content can be indexed from the command line with the help of the hexo algolia command.

$ ./node_modules/.bin/hexo algolia

API Key

A separate API Key must be provided as an environment variable named HEXO_ALGOLIA_INDEXING_KEY. Create it with these limited write access permissions: Add records, Delete records, List indices, Delete index.

$ export HEXO_ALGOLIA_INDEXING_KEY=…
$ ./node_modules/.bin/hexo algolia

Usage

$ ./node_modules/.bin/hexo help algolia
Usage: ./node_modules/.bin/hexo algolia

Description:
Index your content in Algolia Search API

Options:
  --chunk-size=5000  Chunk size for each batch of content to index
  --dry-run          Does not push content to Algolia
  --flush            Does not reset the Algolia index before starting the indexation

Security Concerns

Never use your Admin API Key to index content — you might leak it by mistake and it gives full control of your to others. Please read the Security guide thoroughly.

Keywords

FAQs

Package last updated on 01 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc