Algolia Search

Learn how to configure Algolia search for the Solitude theme.

Install Plugin

Install the hexo-algoliasearch plugin, and modify the theme and Hexo configuration.

Theme Configuration

_config.solitude.yml
# Approximately at lines 856 and 864
search:
  enable: true
  type: algolia # local / algolia / docsearch
  tags:
    # - Solitude
    # - Hexo
  algolia:
    hits:
      per_page: 6

Hexo Configuration

Add the following configuration at the bottom of your _config.yml. Refer to the plugin's README for specific configuration details.

Remember to configure the title, permalink, and content fields in the fields parameter.

_config.yml
algolia:
  appId: "Z7A3XW4R2I"
  apiKey: "12db1ad54372045549ef465881c17e743"
  adminApiKey: "40321c7c207e7f73b63a19aa24c4761b"
  chunkSize: 5000
  indexName: "my-hexo-blog"
  fields:
    - content:strip:truncate,0,500
    - excerpt:strip
    - gallery
    - permalink
    - photos
    - slug
    - tags
    - title