Overview:
11ty Serverless Search is an example of how to use 11ty Serverless to create a site search feature. It allows users to search for content within a website using local and external data sources.
Features:
- Local and External Data: 11ty Serverless Search fetches results from both local and external sources. Local data is generated from an array of post data using a prebuild/prestart Node script. External data is fetched from Stephanie Eckles’ dev.to profile.
- Custom Collection: The combined custom collection is passed through an 11ty filter to search the content and return search results.
- Development Scripts: Includes npm scripts for running 11ty with hot reload at localhost:8080 and building the production version with minified, autoprefixed CSS.
Installation:
To install 11ty Serverless Search, follow these steps:
- Clone the repository:
git clone <repository_url>
- Install the dependencies:
npm install
- Start the development server:
npm start
Browse the site at localhost:8080 for hot reload with Sass changes.
Build the production version:
npm run build
Summary:
11ty Serverless Search is an example of using 11ty Serverless to create a site search feature with both local and external data sources. It provides a custom collection and development scripts for easy setup and usage.