Added tags to search result, search no long matches the project tags (the ones used for filtering) and implemented author page that show up on search.

This commit is contained in:
天クマ 2025-10-25 19:51:28 -03:00
commit e54f2336db
27 changed files with 244 additions and 89 deletions

View file

@ -7,13 +7,17 @@ export default function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("projects/**/*.png");
eleventyConfig.addPassthroughCopy("projects/**/*.jpg");
eleventyConfig.addPassthroughCopy("projects/**/*.jpeg");
eleventyConfig.addPassthroughCopy("authors/**/*.png");
eleventyConfig.addPassthroughCopy("authors/**/*.jpg");
eleventyConfig.addPassthroughCopy("authors/**/*.jpeg");
eleventyConfig.addPassthroughCopy("assets");
eleventyConfig.addCollection('searchIndex', (collectionApi) => {
const result = collectionApi.getAll().map(item => {
return {
title: item.data.projectName,
subtitle: item.data.projectSubtitle || "",
title: item.data.name,
subtitle: item.data.subtitle || "",
author: item.data.author,
url: item.url,
image: (item.data.logoName && item.data.logoExtension) ? item.url + item.data.logoName + '.' + item.data.logoExtension : '',
tags: item.data.tags
@ -29,7 +33,7 @@ export default function (eleventyConfig) {
this.setRef('url');
this.addField('title', { boost: 2 });
this.addField('subtitle');
this.addField('tags')
// this.addField('tags') so search does not match
allPlugins.forEach(doc => this.addDoc(doc));
});