Skip to content

Commit 588a371

Browse files
committed
Refactor: Convert updatesMain to boolean property
Changed updatesMain from array-based tags to boolean frontmatter property for cleaner syntax and better performance. Updated collections plugin to support boolean-based filtering. Affects 12 pages across EN/FR content.
1 parent 38d50b7 commit 588a371

13 files changed

+31
-15
lines changed

eleventy/plugins/collections-plugin.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class CollectionsPlugin extends EleventyBasePlugin {
4040
this.configureChangedPagesCollection(eleventyConfig);
4141
this.configureTaggedCollections(eleventyConfig);
4242
this.configureResourceCollections(eleventyConfig);
43+
this.configureBooleanCollections(eleventyConfig);
4344

4445
this.log('Custom collections configured with caching and performance optimization');
4546
}
@@ -439,6 +440,23 @@ class CollectionsPlugin extends EleventyBasePlugin {
439440
});
440441
}
441442

443+
/**
444+
* Configure boolean-based collections
445+
* These collections are based on boolean frontmatter properties instead of tags
446+
*/
447+
configureBooleanCollections(eleventyConfig) {
448+
// Collection for pages with updatesMain: true
449+
eleventyConfig.addCollection('updatesMain', (collectionApi) => {
450+
const cacheKey = 'updatesMain';
451+
452+
return this.getCached(cacheKey, () => {
453+
return collectionApi.getAll()
454+
.filter(item => item.data.updatesMain === true)
455+
.sort((a, b) => new Date(b.date) - new Date(a.date)); // Most recent first
456+
});
457+
});
458+
}
459+
442460
/**
443461
* Get plugin metadata
444462
*/

src/main/en/how-tos/ms-office-tip-sheets.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn to identify and correct common accessibility issues in the Mi
44
toggle: fiches-de-conseils-pour-microsoft-office
55
tags:
66
- createDocument
7-
- updatesMain
7+
updatesMain: true
88
---
99

1010
{% if collections.msTips === undefined %}

src/main/en/how-tos/test-your-products.njk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ description: Learn how to identify accessibility issues early and throughout the
44
toggle: testez-vos-produits
55
subject:
66
- howTos
7-
tags:
8-
- updatesMain
7+
updatesMain: true
98
---
109

1110
{% if collections.testYourProducts === undefined %}

src/main/fr/comment-faire/fiches-conseils-ms-office.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: Fiches de conseils pour Microsoft Office
3-
description: Apprendre à identifier et à corriger les problèmes daccessibilité courants dans la suite logicielle Microsoft Office.
3+
description: Apprendre à identifier et à corriger les problèmes d'accessibilité courants dans la suite logicielle Microsoft Office.
44
toggle: tip-sheets-for-microsoft-office
55
tags:
66
- createDocument
7-
- updatesMain
7+
updatesMain: true
88
---
99

1010
{% if collections.msTips === undefined %}

src/main/fr/comment-faire/testez-vos-produits.njk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ description: Apprendre à identifier les problèmes d'accessibilité dès le dé
44
toggle: test-your-products
55
subject:
66
- howTos
7-
tags:
8-
- updatesMain
7+
updatesMain: true
98
---
109

1110
{% if collections.testYourProducts === undefined %}

src/pages/en/best-practices-for-accessible-virtual-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ subject:
66
- howTos
77
tags:
88
- accessibleVirtualEvents
9-
- updatesMain
9+
updatesMain: true
1010
hasDocument:
1111
filename: Best_Practices_For_Hosting_Accessible_Events_EN.docx
1212
sizeNumber: 45

src/pages/en/guide-for-including-accessibility-in-information-and-communication-technology-ict-related-procurement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ subject:
99
- accessibilityInTheGovernmentOfCanada
1010
tags:
1111
- procurement
12-
- updatesMain
12+
updatesMain: true
1313
hasDocument:
1414
type: word
1515
sizeNumber: 77

src/pages/en/making-accessible-emails.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Making Accessible Emails
33
description: Accessible email is important for people with disabilities but also for everyone. Find out how to create an accessible email in outlook.
44
tags:
55
- howTos
6-
- updatesMain
6+
updatesMain: true
77
toggle: Rendre vos courriels accessibles
88
tocSimple: true
99
---

src/pages/en/procurement/accessibility-remediation-roadmap-template-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ subject:
88
- accessibilityInTheGovernmentOfCanada
99
tags:
1010
- procurement
11-
- updatesMain
11+
updatesMain: true
1212
hasDocument:
1313
type: word
1414
sizeNumber: 54

src/pages/fr/bonnes-pratiques-pour-les-evenements-virtuels-accessibles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ subject:
66
- howTos
77
tags:
88
- accessibleVirtualEvents
9-
- updatesMain
9+
updatesMain: true
1010
hasDocument:
1111
filename: Best_Practices_For_Hosting_Accessible_Events_FR.docx
1212
sizeNumber: 57.4

0 commit comments

Comments
 (0)