Skip to content

Commit f4ec5db

Browse files
committed
Add tags to search, exclude home from search, add keyword options for search. After push still need to update index
1 parent 44ab698 commit f4ec5db

File tree

8 files changed

+265
-86
lines changed

8 files changed

+265
-86
lines changed

assets/scss/_custom.scss

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,29 @@
5959
color: #005aa7;
6060
font-style: normal;
6161
text-decoration: none !important;
62-
6362
background-color: #FFCBBD;
6463
}
6564

65+
.highlight-yellow-sm {
66+
border: rgba(255, 255, 255, 0) 0.3rem solid;
67+
border-radius: 0.75rem;
68+
padding: 0.25rem 0.5rem !important;
69+
color: #005aa7;
70+
font-style: normal;
71+
text-decoration: none !important;
72+
background-color: #FFFDE4;
73+
}
74+
75+
.highlight-lightblue-sm {
76+
border: rgba(255, 255, 255, 0) 0.3rem solid;
77+
border-radius: 0.75rem;
78+
padding: 0.25rem 0.5rem !important;
79+
color: #005aa7;
80+
font-style: normal;
81+
text-decoration: none !important;
82+
background-color: #E3F0FE;
83+
}
84+
6685
.yellow-button {
6786
margin-left: 20px;
6887
background-color: #005aa7;

content/english/_index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
search:
3+
excludeFromSearch: true
34
title: Building public knowledge for responsible algorithms
45
subtitle: A European knowledge platform for AI bias testing and AI standards.
56
image: /images/logo/logo.svg
@@ -79,9 +80,11 @@ Activity_Feed:
7980
items_title: Upcoming events
8081
activities:
8182
- title: >-
82-
Presentation 'Meaningful human interaction', Network of Dutch Public Service Suppiers
83+
Presentation 'Meaningful human interaction', Network of Dutch Public
84+
Service Suppiers
85+
link: >-
86+
/knowledge-platform/knowledge-base/public_standard_meaningful_human_intervention/
8387
image: /images/partner logo-cropped/NPD.png
84-
link: /knowledge-platform/knowledge-base/public_standard_meaningful_human_intervention/
8588
date: 30-10-2025
8689
type: presentation
8790
- title: >-

content/english/events/activities.md

Lines changed: 151 additions & 74 deletions
Large diffs are not rendered by default.

content/nederlands/_index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
search:
3+
excludeFromSearch: true
34
title: Publieke kennisopbouw voor verantwoorde algoritmes
45
subtitle: Een Europees kennisplatform voor AI bias testing en AI standaarden.
56
image: /images/logo/logo.svg
@@ -84,9 +85,11 @@ Activity_Feed:
8485
items_title: Aankomende events
8586
activities:
8687
- title: >-
87-
Presentatie 'Betekenisvolle menselijke tussenkomst', Netwerk van Publieke Dienstverleners
88+
Presentatie 'Betekenisvolle menselijke tussenkomst', Netwerk van
89+
Publieke Dienstverleners
90+
link: >-
91+
/nl/knowledge-platform/knowledge-base/public_standard_meaningful_human_intervention/
8892
image: /images/partner logo-cropped/NPD.png
89-
link: /nl/knowledge-platform/knowledge-base/public_standard_meaningful_human_intervention/
9093
date: 30-10-2025
9194
type: presentatie
9295
- title: 'Presentatie ''Local-only tools voor AI validatie'', Platform AI & Overheid'

layouts/index.html

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
{{ partial "overview_block.html" .}}
1212

1313
<style>
14-
1514
.search-overlay {
1615
cursor: pointer;
1716
position: fixed;
@@ -27,7 +26,9 @@
2726
&.isfocused {
2827
z-index: 12000;
2928
}
29+
3030
position: relative;
31+
3132
.search-panel {
3233
display: block;
3334
}
@@ -56,12 +57,15 @@
5657
margin-top: 10px;
5758
margin-bottom: 10px;
5859
}
60+
5961
.search-result-image {
6062
height: auto;
6163
width: auto;
64+
6265
@media (min-width: 992px) {
6366
position: absolute;
6467
}
68+
6569
top: 0;
6670
left: 0;
6771
bottom: 0;
@@ -75,6 +79,27 @@
7579
margin-top: 40px;
7680
}
7781

82+
.search-tags-desktop {
83+
@media (max-width: 992px) {
84+
display: none;
85+
}
86+
87+
@media (min-width: 992px) {
88+
bottom: 13px;
89+
}
90+
}
91+
92+
.search-tags-mobile {
93+
@media (min-width: 992px) {
94+
display: none;
95+
}
96+
97+
@media (max-width: 992px) {
98+
top: 30px;
99+
right: 30px;
100+
}
101+
}
102+
78103
ol.ais-Hits-list {
79104
list-style: none;
80105
}
@@ -121,7 +146,7 @@ <h2 class="pt-5 color-blue">{{i18n "search" }}</h2>
121146
indexName: 'website_pages',
122147
searchClient,
123148
future: { preserveSharedStateOnUnmount: true },
124-
searchFunction: function(helper) {
149+
searchFunction: function (helper) {
125150
if (helper.state.query === '') {
126151
return;
127152
}
@@ -163,16 +188,50 @@ <h2 class="pt-5 color-blue">{{i18n "search" }}</h2>
163188
}
164189

165190
const searchInput = $(".ais-SearchBox-input");
166-
if(!searchInput.is(":focus")) {
191+
if (!searchInput.is(":focus")) {
167192
container.querySelector('ol').innerHTML = "";
168193
return;
169194
}
170195

171-
if(!items || !items.length > 0) {
196+
if (!items || !items.length > 0) {
172197
container.querySelector('ol').innerHTML = `<p>{{i18n "search-no-results"}}</p>`;
173198
return;
174199
}
175-
200+
201+
const tagToHighlightClass = (tag) => {
202+
if (tag === "Kennisplatform"
203+
|| tag === "Knowledge platform") {
204+
return `highlight-lightblue-sm`;
205+
}
206+
207+
if (tag === "Algoprudentie"
208+
|| tag === "Algoprudence") {
209+
return `highlight-red-sm`;
210+
}
211+
212+
if (tag === "Technische tools"
213+
|| tag === "Technical tools") {
214+
return `highlight-yellow-sm`;
215+
}
216+
217+
if (tag === "Events"
218+
|| tag === "Evenementen") {
219+
return `highlight-lightblue-sm`;
220+
}
221+
222+
if (tag === "About"
223+
|| tag === "Over ons") {
224+
return `highlight-lightblue-sm`;
225+
}
226+
}
227+
228+
const tagToHtml = (tag) => {
229+
if (!tag) {
230+
return '';
231+
}
232+
return `<span class="${tagToHighlightClass(tag)} mr-3">${tag}</span>`;
233+
};
234+
176235
container.querySelector('ol').innerHTML = items
177236
.map(
178237
item => {
@@ -181,15 +240,22 @@ <h2 class="pt-5 color-blue">{{i18n "search" }}</h2>
181240
<a href=${item.url} class="container">
182241
<div class="row search-result-row">
183242
<div class="col-12 col-lg-2">
243+
<div class="position-absolute search-tags-mobile">
244+
${tagToHtml(item.tag)}
245+
</div>
184246
<div class="my-3 text-center image-frame">
185247
<img class="image-fluid search-result-image d-inline p-2" src='${item.image}' alt='${item.title}' />
186248
</div>
187249
</div>
188250
<div class="col-12 col-lg-10">
189251
<h3 class="color-blue search-result-title">${item._highlightResult.title.value}</h3>
190252
<p class="color-gray search-result-subtitle">${item._highlightResult.subtitle.value}</p>
253+
<div class="position-absolute search-tags-desktop">
254+
${tagToHtml(item.tag)}
255+
</div>
191256
</div>
192257
</div>
258+
193259
</a>
194260
</li>
195261
`;

layouts/partials/head.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717

1818
<meta name="algolia-site-verification" content="5A3FFC70E885F0D0" />
1919

20+
<meta name="search_exclude" content="{{if .Params.search.excludeFromSearch}}true{{end}}">
2021
<meta name="search_title" content="{{if .Params.search.title}}{{.Params.search.title}}{{else}}{{.Params.title}}{{end}}">
2122
<meta name="search_subtitle" content="{{if .Params.search.title}}{{.Params.search.subtitle}}{{else}}{{.Params.subtitle}}{{end}}">
2223
<meta name="search_image" content="{{if .Params.search.image}}{{.Params.search.image | relURL}}{{else}}{{.Params.image | relURL}}{{end}}">
24+
<meta name="search_content" content="{{if .Params.search.searchableText}}{{.Params.search.searchableText}}{{end}}">
2325

2426
<!--Favicon-->
2527
<link rel="shortcut icon" href="{{ site.Params.favicon | absURL }}" type="image/x-icon">

tina/collections/shared/page/search.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ const search: TinaField = {
77
description:
88
"Search configuration for Algolia. This will be used to populate the search index. If left empty, the values above will be used. It is recommended to fill this out for better search results.",
99
fields: [
10+
{
11+
type: "boolean",
12+
name: "excludeFromSearch",
13+
label: "Exclude from Algolia Search",
14+
},
1015
{
1116
type: "string",
1217
name: "title",
@@ -21,7 +26,11 @@ const search: TinaField = {
2126
type: "image",
2227
name: "image",
2328
label: "Image",
24-
required: true,
29+
},
30+
{
31+
type: "string",
32+
name: "searchableText",
33+
label: "Searchable Text",
2534
},
2635
],
2736
};

tina/tina-lock.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)