tags.map(tag => `<span class="tag">${tag}</span>`).join('')}
            </div>
          ` : ''}
          <div class="post-excerpt">
            ${post.excerpt}
          </div>
        </article>
      `
    }

    async function filterPosts() {
      const searchTerm = searchInput.value.toLowerCase()
      const data = await loadSearchIndex()
      
      const filteredPosts = data.posts.filter(post => {
        const matchesSearch = searchTerm === '' || 
          post.title.toLowerCase().includes(sear