All Projects → oncletom → Hexo Algolia

oncletom / Hexo Algolia

Licence: mit
Index your hexo website content to Algolia Search.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Hexo Algolia

Made Mistakes Jekyll
Source for my website and blog (Jekyll + Gulp + Netlify)
Stars: ✭ 436 (+638.98%)
Mutual labels:  algolia
Gatsby Starter Personal Blog
A ready to use, easy to customize, fully equipped GatsbyJS blog starter with 'like app' layout and views transitions.
Stars: ✭ 817 (+1284.75%)
Mutual labels:  algolia
Github Awesome Autocomplete
Add instant search capabilities to GitHub's search bar
Stars: ✭ 1,015 (+1620.34%)
Mutual labels:  algolia
Instantsearch Ios
⚡️ A library of widgets and helpers to build instant-search applications on iOS.
Stars: ✭ 498 (+744.07%)
Mutual labels:  algolia
Gatsby Gitbook Starter
Generate GitBook style modern docs/tutorial websites using Gatsby + MDX
Stars: ✭ 700 (+1086.44%)
Mutual labels:  algolia
Algolia Swift Demo
iOS instant search tutorial
Stars: ✭ 23 (-61.02%)
Mutual labels:  algolia
Algoliasearch Wordpress
❌🗑🙅‍♂️ Algolia Search plugin for WordPress is no longer supported. Please use our API client guide instead
Stars: ✭ 357 (+505.08%)
Mutual labels:  algolia
Nextjs Woocommerce
NextJS (React) eCommerce site with WooCommerce backend
Stars: ✭ 53 (-10.17%)
Mutual labels:  algolia
Vue Instantsearch
👀 Algolia components for building search UIs with Vue.js
Stars: ✭ 707 (+1098.31%)
Mutual labels:  algolia
Algolia Webcrawler
Simple node worker that crawls sitemaps in order to keep an algolia index up-to-date
Stars: ✭ 40 (-32.2%)
Mutual labels:  algolia
Jekyll Theme Basically Basic
Your new Jekyll default theme
Stars: ✭ 524 (+788.14%)
Mutual labels:  algolia
Places
🌐 Turn any <input> into an address autocomplete
Stars: ✭ 5,322 (+8920.34%)
Mutual labels:  algolia
Vue Instantsearch Examples
Examples for Vue InstantSearch v1, v2 links: https://github.com/algolia/vue-instantsearch-examples/issues/50
Stars: ✭ 32 (-45.76%)
Mutual labels:  algolia
Awesome Algolia
🔍👋 START HERE! A curated list of Algolia libraries, resources and projects.
Stars: ✭ 475 (+705.08%)
Mutual labels:  algolia
Virapro.ru
[E-commerce] Plumbing Store
Stars: ✭ 45 (-23.73%)
Mutual labels:  algolia
Vscodethemes
Preview themes from the VSCode marketplace.
Stars: ✭ 374 (+533.9%)
Mutual labels:  algolia
Algoliasearch Client Javascript
⚡️ A fully-featured and blazing-fast JavaScript API client to interact with Algolia.
Stars: ✭ 907 (+1437.29%)
Mutual labels:  algolia
Instantsearch Ios Examples
Example apps built with InstantSearch iOS
Stars: ✭ 55 (-6.78%)
Mutual labels:  algolia
Minimal Mistakes
📐 Jekyll theme for building a personal site, blog, project documentation, or portfolio.
Stars: ✭ 8,967 (+15098.31%)
Mutual labels:  algolia
Heyyoo
Heyyoo is a sample social media Android application 📱 built to demonstrate use of Modern Android development tools - (Kotlin, Coroutines, Architecture Components, MVVM, Room, Retrofit, Material Components).
Stars: ✭ 38 (-35.59%)
Mutual labels:  algolia

hexo-algolia Build Status

Index content of your hexo website in Algolia and add search within minutes.

hexo-algolia is an hexo plugin provided by the community. This is what you get when you install it:

  1. a new command, hexo algolia, to index the content of your website
  2. a theme helper to include Algolia search client
  3. another theme helper to configure the Algolia search client

👌 The hexo algolia command can be run manually on your computer and on a continuous integration system like [Travis CI][-ci-node].

📜 Browse the CHANGELOG to learn what has changed between versions. ⬢ Compatible with node>=4.0.0.

hexo theme

Install

$ npm install --save hexo-algolia

Public Facing Search Options

You can configure Algolia integration to your hexo website with the _config.yml file:

algolia:
  applicationID: 'applicationID'
  apiKey: 'apiKey'
  indexName: '...'
Config Key
applicationID  Your Algolia Application ID
apiKey A Search-Only API key
indexName The name of the Algolia index to use

These configuration values are accessible from your hexo theme, to be used with Algolia JavaScript client.

Hexo Theme Setup

Helpers are provided to make your life easier.

Include Algolia JavaScript Client

The algolia_search theme helper adds the Algolia search client to your pages.

<%- algolia_search() %>

Renders as:

<script src="/assets/algolia/algoliasearchLite.min.js" async></script>

Configure Algolia JavaScript Client

You can make your index configuration available to your page and client-side scripts by adding the algolia_config() hexo helper in the <head> of your document.

<%- algolia_search_config() %>

Once done, you can retrieve Algolia configuration by querying the data attribute of the algolia:search meta tag.

const algoliaConfig = document.querySelector('meta[property="algolia:search"]').dataset;

const client = algoliasearch(algoliaConfig.applicationId, algoliaConfig.apiKey);
const index = client.initIndex(algoliaConfig.indexName);

Display Search Results

It is now up to you to use the aforementioned example to trigger a search and display the results in your page.

If you need some help, have a look at the search client doc and the tutorials.

Indexing Content

Content is indexed 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:
  --dry-run       Does not push content to Algolia (default: false).
  --flush         Resets the Algolia index before starting the indexation (default: false).
  --indexing-key  An algolia API key with add/delete records permissions.
		  It should be different than the search-only API key configured in _config.yml.
  --layouts       A comma-separated list of page layouts to index (default: "page").

Security Concerns

Never store your Admin API Key as apiKey in the _config.yml file: it would give full control of your Algolia index to others and you don't want to face the consequences.

Please read Algolia Security guide thoroughly if you need some more informations about this.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].