Skip to content

Commit

Permalink
feat: Update home text in breadcrumb and add breadcrumbs to home page (
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanWallace authored May 27, 2024
1 parent 81f214a commit bf13a9a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/_data/breadcrumbs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
en: {
linkText: 'Home',
linkText: 'GC Design System',
url: '/en',
breadcrumb: 'breadcrumb',
},
fr: {
linkText: 'Accueil',
linkText: 'Système de design GC',
url: '/fr',
breadcrumb: "Fil d'Ariane",
},
Expand Down
31 changes: 16 additions & 15 deletions src/_includes/partials/breadcrumbs.njk
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{% if eleventyNavigation or tags %}

{% set key = eleventyNavigation.key if eleventyNavigation else tags[0] %}

{% set navPages = collections.all | eleventyNavigationBreadcrumb(key) %}

<gcds-breadcrumbs lang="{{ locale }}" slot="breadcrumb">
<gcds-breadcrumbs-item href={{ breadcrumbs[locale].url | url }}>
{{ breadcrumbs[locale].linkText }}
</gcds-breadcrumbs-item>
{% for item in navPages %}
{% if item.url %}
<gcds-breadcrumbs-item href={{ item.url | url }}>
{{ item.title }}
</gcds-breadcrumbs-item>
{% endif %}
{% endfor %}
{% if eleventyNavigation or tags %}
<gcds-breadcrumbs-item href={{ breadcrumbs[locale].url | url }}>
{{ breadcrumbs[locale].linkText }}
</gcds-breadcrumbs-item>

{% set key = eleventyNavigation.key if eleventyNavigation else tags[0] %}

{% set navPages = collections.all | eleventyNavigationBreadcrumb(key) %}
{% for item in navPages %}
{% if item.url %}
<gcds-breadcrumbs-item href={{ item.url | url }}>
{{ item.title }}
</gcds-breadcrumbs-item>
{% endif %}
{% endfor %}
{% endif %}
</gcds-breadcrumbs>
{% endif %}

0 comments on commit bf13a9a

Please sign in to comment.