Skip to content

Commit 1029f71

Browse files
committed
feat: improve role system with centralized messaging and collection exclusion
• Add eleventyExcludeFromCollections to all role pages until content tagging begins • Create reusable role-content-coming-soon.njk partial for consistent messaging • Add internationalized role content messages to alerts.js data file • Update role pages to show 'Coming soon' messages when no content is tagged • Fix role group TOC to display all roles regardless of content availability • Ensure consistent user experience across individual and group role pages
1 parent 1d7b755 commit 1029f71

File tree

10 files changed

+42
-20
lines changed

10 files changed

+42
-20
lines changed

src/_data/alerts.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ module.exports = {
2121
"Les liens qui ne fonctionnent que derrière le pare-feu du gouvernement du Canada sont marqués avec ",
2222
icon: "icône ",
2323
hiddenTextLink: "lien interne",
24+
25+
// Role content coming soon alert, appears on role pages when no content is tagged with that role
26+
roleContentComingSoon: "Bientôt disponible !",
27+
roleContentComingSoonText: "Actuellement, aucun contenu n'a été assigné à ce rôle. Une fois que le contenu sera étiqueté avec ce rôle, il sera listé sur cette page.",
28+
roleContentComingSoonTextGroup: "Actuellement, aucun contenu n'a été assigné à ce rôle. Une fois que le contenu sera étiqueté avec ce rôle, il sera listé ici.",
2429
},
2530

2631
en: {
@@ -43,5 +48,10 @@ module.exports = {
4348
"Links that only work within the Government of Canada firewall are marked with ",
4449
icon: "icon ",
4550
hiddenTextLink: "internal link",
51+
52+
// Role content coming soon alert, appears on role pages when no content is tagged with that role
53+
roleContentComingSoon: "Coming soon!",
54+
roleContentComingSoonText: "Currently no content has been assigned to this role. Once content is tagged with this role, it will be listed on this page.",
55+
roleContentComingSoonTextGroup: "Currently no content has been assigned to this role. Once content is tagged with this role, it will be listed here.",
4656
},
4757
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{#
2+
Role content coming soon alert
3+
Usage: {% include "partials/role-content-coming-soon.njk" %}
4+
Optional parameter: variant="group" for group pages (changes the text slightly)
5+
#}
6+
<div class="alert alert-info">
7+
<p><strong>{{ alerts[locale].roleContentComingSoon }}</strong> {% if variant == "group" %}{{ alerts[locale].roleContentComingSoonTextGroup }}{% else %}{{ alerts[locale].roleContentComingSoonText }}{% endif %}</p>
8+
</div>

src/_includes/partials/role-group-sections.njk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
| localeMatch(locale)
88
| sort(false, false, 'data.title') %}
99

10-
{% if items.length %}
1110
<section class="mrgn-bttm-xl">
1211
<h2 id="{{ anchor }}">{{ label }}</h2>
13-
<p><a href="{{ pathPrefix }}{{ permalinkPrefix }}{{ locale }}/roles/{{ rk }}/">{% if lang == 'fr' %}Aller à la page {{ label | lower }} <small class="text-muted">({{ items.length }})</small>{% else %}Go to {{ label | lower }} page <small class="text-muted">({{ items.length }})</small>{% endif %}</a></p>
12+
<p><a href="{{ pathPrefix }}{{ permalinkPrefix }}{{ locale }}/roles/{{ rk }}/">{% if lang == 'fr' %}Aller à la page {{ label | lower }}{% else %}Go to {{ label | lower }} page{% endif %}</a>{% if items.length %} <small class="text-muted">({{ items.length }})</small>{% endif %}</p>
13+
14+
{% if items.length %}
1415
<div class="row wb-eqht mrgn-tp-lg gc-drmt">
1516
{% for item in items %}
1617
<div class="col-md-6">
@@ -36,6 +37,9 @@
3637
</div>
3738
{% endfor %}
3839
</div>
40+
{% else %}
41+
{% set variant = "group" %}
42+
{% include "partials/role-content-coming-soon.njk" %}
43+
{% endif %}
3944
</section>
40-
{% endif %}
4145
{% endfor %}

src/_includes/partials/role-mini-toc.njk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
| byAnyRole([rk])
1010
| localeMatch(locale)
1111
| sort(false, false, 'data.title') %}
12-
{% if items.length %}
1312
<li class="list-inline-item">
1413
<a href="#{{ anchor }}">{{ label }}</a>
15-
<small class="text-muted">({{ items.length }})</small>
14+
{% if items.length %}<small class="text-muted">({{ items.length }})</small>{% endif %}
1615
</li>
17-
{% endif %}
1816
{% endfor %}
1917
</ul>
2018
</aside>

src/main/en/role.njk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
tags: role
3+
eleventyExcludeFromCollections: true
34
pagination:
45
data: rolePairs # global (see below)
56
size: 1
@@ -93,4 +94,9 @@ eleventyComputed:
9394
{% endfor %}
9495
</div>
9596
</section>
97+
{% else %}
98+
<section class="mrgn-bttm-xl">
99+
<h2>Resources and guidance</h2>
100+
{% include "partials/role-content-coming-soon.njk" %}
101+
</section>
96102
{% endif %}

src/main/en/roles-group.njk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
tags: roleGroup
3+
eleventyExcludeFromCollections: true
34
pagination:
45
data: groupPairsEn # make this global (see below)
56
size: 1

src/main/en/roles/index.njk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Accessibility in your role
33
description: We all have a role to play in accessibility. Learn more about job-specific accessibility tips and how to integrate them into your day-to-day work.
44
permalink: '/{{ locale }}/roles/'
55
toggle: roles
6+
eleventyExcludeFromCollections: true
67
tags:
78
- main
89
---

src/main/fr/role.njk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
tags: role
3+
eleventyExcludeFromCollections: true
34
pagination:
45
data: rolePairs
56
size: 1
@@ -93,4 +94,9 @@ eleventyComputed:
9394
{% endfor %}
9495
</div>
9596
</section>
97+
{% else %}
98+
<section class="mrgn-bttm-xl">
99+
<h2>Ressources et conseils</h2>
100+
{% include "partials/role-content-coming-soon.njk" %}
101+
</section>
96102
{% endif %}

src/main/fr/roles-group.njk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
tags: roleGroup
3+
eleventyExcludeFromCollections: true
34
pagination:
45
data: groupPairsFr
56
size: 1

src/main/fr/roles/index.njk

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,7 @@ title: Rôles d'accessibilité
33
description: Aperçu des rôles et responsabilités pour assurer l'accessibilité dans les produits et services numériques, basé sur la cartographie des rôles et responsabilités d'accessibilité (ARRM) du W3C WAI.
44
permalink: '/{{ locale }}/roles/'
55
toggle: roles
6-
role:
7-
- businessAnalysis
8-
- contentAuthoring
9-
- contentPublishing
10-
- uxResearch
11-
- uxDesign
12-
- visualDesign
13-
- frontEndDev
14-
- backEndDev
15-
- qaAutomated
16-
- qaManual
17-
- productOwnership
18-
- projectManagement
19-
- governance
6+
eleventyExcludeFromCollections: true
207
tags:
218
- main
229
---

0 commit comments

Comments
 (0)