Coder Social home page Coder Social logo

algolia-hugo's Introduction

Algolia search uploader for Hugo

Algolia is a hosted search platform geared towards business users, but provides a free limited Community tier of their product. It integrates with Hugo quite well if you instruct Hugo to build a JSON site index file.

First, sign up for an Algolia account. Create an index for your website. Take note of your Admin API key and App ID. You will need both of those, as well as the name of the index you created, to use this tool.

The configuration file for this tool lives at $XDG_CONFIG_HOME/algolia-hugo/algolia-hugo.yaml, which by default points to $HOME/.config/algolia-hugo/algolia-hugo.yaml. Place the following contents into that file.

algolia_app_id: <your app id>
algolia_api_key: <your api key>
algolia_index_name: <your index name>

It can also be configured via environment variables for ease of use in docker containers or on CI/CD platforms like CircleCI. Just set variables named as above, only all-caps.

ALGOLIA_APP_ID=<appid> ALGOLIA_API_KEY=<api_key> ALGOLIA_INDEX_NAME=<index_name> algolia_hugo config

Usage

This tool has very little functionality right now. There are three commands.

update

This will update your search objects in the Algolia index. It does this by deleting the existing objects and uploading the entire index again. In this way it alleviates the problem of old search objects that may have been edited or deleted remaining in the index. Future versions of this tool may support updating existing objects when I find both time and need.

By default this tool will look for a file named public/index.json relative to the current directory. This can be overridden with the -f or --file arguments to the update command.

clear

This command simply clears your search index on Algolia, leaving you with an empty index.

config

This command is used to show the config file found by this tool, as well as showing the configuration fields read in.

help

Full help is available by running the help command, or by executing the tool without any subcommands.

algolia-hugo's People

Contributors

duckpuppy avatar lorenaramonda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.