Creating an Algolia helper plugin that can read from a project’s files
This plugin has a lot of work to do. We have three simple filters to add, a complex filter, and an event that we can use to send the JSON data from a project to Algolia.
Let’s get things set up as before. Navigate to the final plugin directory of this project, /project-5/start/eleventy-plugin-algolia-helper
, and run the project. Then, let’s add our simple filters from Chapter 8 – jsDate
, jsonify
, and htmlStrip
:
module.exports = function(eleventyConfig, options) { eleventyConfig.addFilter ("jsDate", function(dateString) { return new Date(dateString); }); eleventyConfig.addFilter("jsonify", function(content) { return JSON.stringify(content...