![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
hexo-algolia
Advanced tools
Index content of your hexo website in Algolia and add search within minutes.
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:
hexo algolia
, to index the content of your website👌 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
.
$ npm install --save hexo-algolia
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.
Helpers are provided to make your life easier.
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>
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);
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.
Content is indexed with the help of the hexo algolia
command.
$ ./node_modules/.bin/hexo algolia
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
$ ./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").
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.
FAQs
Index content of your hexo website in Algolia and add search within minutes.
The npm package hexo-algolia receives a total of 113 weekly downloads. As such, hexo-algolia popularity was classified as not popular.
We found that hexo-algolia demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.