Files
rpg-static-site/content/episodes/search-index.11ty.js
Anthony Correa 385694fb75 feat: enhance podcast functionality and build pipeline
- Dynamically resolve image paths for podcast episodes in `episodes.11tydata.js`
- Add podcast metadata handling with inferred URLs for MP3 and transcripts
- Introduce search functionality with Lunr.js and a search index generator
- Update Eleventy path prefix handling to support environment variable override
- Add `.mp4` files to `.gitignore`
- Expand VSCode settings to include Markdown-Eleventy support and improved terminal history
- Add deployment script (`deploy.sh`) with remote rsync-based deployment and permission handling
- Adjust episode layout to use dynamic image paths and updated podcast metadata
- Add search and members page updates, including new URLs and search integration
- Update dependencies to include `html-to-text` and related packages for search indexing
2024-12-23 13:30:22 -06:00

23 lines
576 B
JavaScript

import markdownit from 'markdown-it';
import { convert } from 'html-to-text';
const md = markdownit({html: true})
class SearchIndex {
data() {
return {eleventyExcludeFromCollections:["episode"], layout: null}
}
render (data) {
const documents = data.collections.episode.map((episode)=>{
return {
url:`${this.url(episode.url)}`,
title: episode.data.title,
text: convert (episode.content),
season: episode.data.season,
episode: episode.data.episode
}})
return JSON.stringify(documents);
}
}
export default SearchIndex