Skip to content

Commit 0fc6d71

Browse files
author
hjonin
committed
gh-1 migrate code.gouv.fr website
- Use new eleventy-dsfr template - Update navigation - Merge Bluehats ressources - Update layouts
1 parent 17526e8 commit 0fc6d71

File tree

253 files changed

+6334
-535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+6334
-535
lines changed

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 DINUM/Etalab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

LICENSES/LICENSE.MIT.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 DINUM/Etalab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

_data/data.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
footer_content_description: `Mission logiciels libres et communs numériques porté par la <a href="https://www.numerique.gouv.fr/" target="_blank">direction interministérielle du numérique</a>.`
3+
}

_data/i18n/en/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ module.exports = {
33
accessibility: "Accessibility",
44
blog: "Blog",
55
close: "Close",
6+
copy: "Copy",
7+
copied: "Copied!",
68
dark_theme: "Dark Theme",
79
display_params: "Display Parameters",
10+
filter_by_tag: "Filter by Tag:",
811
first_page: "First page",
912
follow_us: "Follow Us",
10-
footer_content_description: "Lorem [...] elit ut.",
1113
fully_compliant: "Fully compliant",
1214
home: "Home",
1315
lang_name: "English",
@@ -26,11 +28,10 @@ module.exports = {
2628
published_on: "Published on",
2729
see_breadcrumb: "See Breadcrumb",
2830
select_lang: "Select Language",
29-
service_id: "Intitulé <br>officiel",
30-
service_name: "Nom de l’entité (ministère, secrétariat d‘état, gouvernement)",
31-
site_description: "baseline - précisions sur l‘organisation",
31+
share: "Share",
32+
share_by_email: "Share by Email",
33+
share_link_on: "Share link on",
3234
sitemap: "Sitemap",
33-
site_title: "Nom du site / service",
3435
subscribe: "Subscribe",
3536
subscribe_newsletter: "Subscribe",
3637
system: "System",

_data/i18n/fr/index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ module.exports = {
33
accessibility: "Accessibilité",
44
blog: "Blog",
55
close: "Fermer",
6+
copy: "Copier dans le presse-papier",
7+
copied: "Copié !",
68
dark_theme: "Thème sombre",
7-
display_params: "Paramètres d\'affichage",
9+
display_params: "Paramètres d'affichage",
10+
filter_by_tag: "Filtrer par catégorie :",
811
first_page: "Première page",
9-
follow_us: "Suivez-nous <br> sur les réseaux sociaux",
10-
footer_content_description: "Lorem [...] elit ut.",
12+
follow_us: "Suivez-nous <br> sur nos réseaux",
1113
fully_compliant: "Totalement conforme",
1214
home: "Accueil",
1315
lang_name: "Français",
@@ -26,12 +28,11 @@ module.exports = {
2628
published_on: "Publié le",
2729
see_breadcrumb: "Voir le fil d’Ariane",
2830
select_lang: "Sélectionner une langue",
29-
service_id: "Intitulé <br>officiel",
30-
service_name: "Nom de l’entité (ministère, secrétariat d‘état, gouvernement)",
31-
site_description: "baseline - précisions sur l‘organisation",
31+
share: "Partager",
32+
share_by_email: "Partager par email",
33+
share_link_on: "Partage d'un lien sur",
3234
sitemap: "Plan du site",
33-
site_title: "Nom du site / service",
34-
subscribe: "S\'abonner",
35+
subscribe: "S'abonner",
3536
subscribe_newsletter: "Abonnez-vous à notre lettre d’information",
3637
system: "Système",
3738
tags: "Catégories",

_data/metadata.js

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
module.exports = {
2-
"title": "TITRE DU SITE",
3-
"url": "https://url_du_site.gouv.fr/",
4-
"newsletter": {
5-
"url": "",
6-
"title": "",
7-
"description": ""
8-
},
9-
"facebook_url": "",
10-
"twitter_url": "",
11-
"instagram_url": "",
12-
"linkedin_url": "",
13-
"youtube_url": "",
14-
"language": "fr",
15-
"description": "DESCRIPTION DU SITE",
16-
"author": {
17-
"name": "NOM DU SERVICE",
18-
"email": "contact@nom_du_service.gouv.fr",
19-
"url": "https://url_du_service.gouv.fr/"
20-
}
2+
"title": "Mission logiciels libres et communs numériques",
3+
"url": "https://code.gouv.fr/",
4+
"newsletter": [
5+
{
6+
"url": "https://code.gouv.fr/newsletters/subscribe/[email protected]",
7+
"title": "Gazette BlueHats",
8+
"description": "Votre lettre d'information sur les logiciels libres par et pour les administrations."
9+
},
10+
{
11+
"url": "https://code.gouv.fr/newsletters/subscribe/[email protected]",
12+
"title": "Gazette DSI Libre",
13+
"description": "Lettre d'information sur les logiciels libres pour les DSI du secteur public."
14+
}
15+
],
16+
"facebook_url": "",
17+
"mastodon_url": "https://mastodon.social/@CodeGouvFr",
18+
"twitter_url": "https://twitter.com/codegouvfr",
19+
"instagram_url": "",
20+
"linkedin_url": "",
21+
"youtube_url": "",
22+
"github_url": "https://github.com/codegouvfr/",
23+
"sourcehut_url": "https://man.sr.ht/~codegouvfr/",
24+
"language": "fr",
25+
"description": "Recourir et contribuer aux logiciels libres et aux communs numériques",
26+
"author": {
27+
"name": "Mission logiciels libres de la DINUM",
28+
"email": "[email protected]",
29+
"url": "https://code.gouv.fr/mission/"
30+
},
31+
"service": "Direction interministérielle du numérique"
2132
}

_includes/components/breadcrumb.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{# Works with eleventyNavigation or mandatory variable `segments: { url: string, title: string }[]` to make it work #}
22
{% if eleventyNavigation %}
3-
{% set segments = collections.all | eleventyNavigationBreadcrumb(eleventyNavigation.key) %}
3+
{% set segments = collections.all | filterCollectionLang | eleventyNavigationBreadcrumb(eleventyNavigation.key) %}
44
{% endif %}
55
<nav role="navigation" class="fr-breadcrumb" aria-label="{{ "you_are_here" | i18n }}:">
66
<button class="fr-breadcrumb__button" aria-expanded="false"

_includes/components/callout.njk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{# Mandatory variable `callout { title: string, description: string, link: { url: string, title: string } }` to make it work #}
2+
<div class="fr-callout">
3+
<h3 class="fr-callout__title">{{ callout.title }}</h3>
4+
<p class="fr-callout__text">
5+
{{ callout.description | safe }}
6+
</p>
7+
{% if callout.link %}
8+
<a class="fr-btn" href="{{ callout.link.url }}">
9+
{{ callout.link.title }}
10+
</a>
11+
{% endif %}
12+
</div>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{# Mandatory variable `card { external_url: string, title: string, description: string, tags: string[], date: string, imagePath: string, imageAlt: string }` to make it work #}
2+
<div class="fr-card fr-card--horizontal-tier">
3+
<div class="fr-card__body">
4+
<div class="fr-card__content">
5+
<h3 class="fr-card__title">{{ card.title }}</h3>
6+
<p class="fr-card__desc">{{ card.description | stripTags }}</p>
7+
<div class="fr-card__start">
8+
{% set tags = card.tags %}
9+
{% include "components/taggroup-disabled.njk" %}
10+
{% if card.date %}
11+
<p class="fr-card__detail fr-icon-time-fill">
12+
<time class="postlist-date"
13+
datetime="{{ card.date | htmlDateString }}">{{ card.date | readableDate("LLLL yyyy") }}</time>
14+
</p>
15+
{% endif %}
16+
</div>
17+
</div>
18+
<div class="fr-card__footer">
19+
<ul class="fr-links-group">
20+
<li>
21+
{% set url_description %}{% if card.url_description %}En savoir plus sur {{ card.url_description }}{% else %}En savoir plus{% endif %}{% endset %}
22+
<a class="fr-link fr-icon-arrow-right-line fr-link--icon-right" href="{{ card.external_url }}" title="{{ url_description }} - {{ "new_window" | i18n }}">
23+
{{ url_description }}
24+
</a>
25+
</li>
26+
</ul>
27+
</div>
28+
</div>
29+
{% if card.imagePath %}
30+
<div class="fr-card__header">
31+
<div class="fr-card__img">{% image card.imagePath, card.imageAlt %}</div>
32+
</div>
33+
{% endif %}
34+
</div>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{# Mandatory variable `card { external_url: string, title: string, description: string, tags: string[], date: string, imagePath: string, imageAlt: string }` to make it work #}
2+
<div class="fr-card">
3+
<div class="fr-card__body">
4+
<div class="fr-card__content">
5+
<h3 class="fr-card__title">{{ card.title }}</h3>
6+
<p class="fr-card__desc">{{ card.description | stripTags }}</p>
7+
<div class="fr-card__start">
8+
{% set tags = card.tags %}
9+
{% include "components/taggroup-disabled.njk" %}
10+
{% if card.date %}
11+
<p class="fr-card__detail fr-icon-time-fill">
12+
<time class="postlist-date"
13+
datetime="{{ card.date | htmlDateString }}">{{ card.date | readableDate("LLLL yyyy") }}</time>
14+
</p>
15+
{% endif %}
16+
</div>
17+
</div>
18+
<div class="fr-card__footer">
19+
<ul class="fr-links-group">
20+
<li>
21+
{% set url_description %}{% if card.url_description %}En savoir plus sur {{ card.url_description }}{% else %}En savoir plus{% endif %}{% endset %}
22+
<a class="fr-link fr-icon-arrow-right-line fr-link--icon-right" href="{{ card.external_url }}" target="_blank" title="{{ url_description }} - {{ "new_window" | i18n }}">
23+
{{ url_description }}
24+
</a>
25+
</li>
26+
</ul>
27+
</div>
28+
</div>
29+
{% if card.imagePath %}
30+
<div class="fr-card__header">
31+
<div class="fr-card__img">{% image card.imagePath, card.imageAlt %}</div>
32+
</div>
33+
{% endif %}
34+
</div>

_includes/components/card-horizontal.njk

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="fr-card__body">
44
<div class="fr-card__content">
55
<h3 class="fr-card__title"><a href="{{ card.url | locale_url }}">{{ card.title }}</a></h3>
6-
<p class="fr-card__desc">{{ card.description }}</p>
6+
<p class="fr-card__desc">{{ card.description | stripTags }}</p>
77
<div class="fr-card__start">
88
{% set tags = card.tags %}
99
{% include "components/taggroup-disabled.njk" %}
@@ -14,9 +14,18 @@
1414
</div>
1515
</div>
1616
</div>
17-
{% if card.imagePath %}
1817
<div class="fr-card__header">
18+
{% if card.badges %}
19+
<ul class="fr-badges-group">
20+
{% for badge in card.badges %}
21+
<li>
22+
<p class="fr-badge fr-badge--green-emeraude">{{ badge }}</p>
23+
</li>
24+
{% endfor %}
25+
</ul>
26+
{% endif %}
27+
{% if card.imagePath %}
1928
<div class="fr-card__img">{% image card.imagePath, card.imageAlt %}</div>
29+
{% endif %}
2030
</div>
21-
{% endif %}
2231
</div>

_includes/components/card.njk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
<h3 class="fr-card__title"><a href="{{ card.url | locale_url }}">{{ card.title }}</a></h3>
66
<p class="fr-card__desc">{{ card.description }}</p>
77
<div class="fr-card__start">
8+
{% if card.tags %}
89
{% set tags = card.tags %}
10+
{% endif %}
911
{% include "components/taggroup-disabled.njk" %}
12+
{% if card.date %}
1013
<p class="fr-card__detail fr-icon-time-fill">
1114
<time class="postlist-date"
1215
datetime="{{ card.date | htmlDateString }}">{{ card.date | readableDate("LLLL yyyy") }}</time>
1316
</p>
17+
{% endif %}
1418
</div>
1519
</div>
1620
</div>

_includes/components/footer.njk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<div class="fr-container">
33
<div class="fr-footer__body">
44
<div class="fr-footer__brand fr-enlarge-link">
5-
<a href="{{ "/" | locale_url }}" title="{{ "home" | i18n }} - {{ "service_name" | i18n }}">
6-
<p class="fr-logo"> {{ "service_id" | i18n | safe }} </p>
5+
<a href="{{ "/" | locale_url }}" title="{{ "home" | i18n }} - {{ metadata.service }}">
6+
<p class="fr-logo">République<br />française</p>
77
</a>
88
</div>
99
<div class="fr-footer__content">
10-
<p class="fr-footer__content-desc">{{ "footer_content_description" | i18n }}</p>
10+
<p class="fr-footer__content-desc">{{ data.footer_content_description | safe }}</p>
1111
<ul class="fr-footer__content-list">
1212
<li class="fr-footer__content-item"><a class="fr-footer__content-link" target="_blank"
1313
href="https://legifrance.gouv.fr">legifrance.gouv.fr</a>

_includes/components/header.njk

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="fr-header__body-row">
66
<div class="fr-header__brand fr-enlarge-link">
77
<div class="fr-header__brand-top">
8-
<div class="fr-header__logo"><p class="fr-logo"> {{ "service_id" | i18n | safe }} </p></div>
8+
<div class="fr-header__logo"><p class="fr-logo">République<br />française</p></div>
99
<div class="fr-header__navbar">
1010
<button class="fr-btn--menu fr-btn" data-fr-opened="false" aria-controls="modal-491"
1111
aria-haspopup="menu" id="button-492"
@@ -15,23 +15,22 @@
1515
</div>
1616
<div class="fr-header__service">
1717
<a href="{{ "/" | locale_url }}"
18-
title="{{ "home" | i18n }} - {{ "site_title" | i18n }} - {{ "service_name" | i18n }}">
19-
<p class="fr-header__service-title"> {{ "site_title" | i18n }} </p>
18+
title="{{ "home" | i18n }} - {{ metadata.title }} - {{ metadata.service }}">
19+
<p class="fr-header__service-title"> {{ metadata.title }} </p>
2020
</a>
21-
<p class="fr-header__service-tagline">{{ "site_description" | i18n }}</p>
21+
<p class="fr-header__service-tagline">{{ metadata.description }}</p>
2222
</div>
2323
</div>
2424
<div class="fr-header__tools">
2525
<div class="fr-header__tools-links">
26-
<ul class="fr-btns-group">
26+
<ul class="fr-links-group">
2727
<li>
28-
<button class="fr-btn fr-fi-theme-fill fr-link--icon-left"
29-
aria-controls="fr-theme-modal"
30-
data-fr-opened="false">{{ "display_params" | i18n }}
31-
</button>
28+
<a class="fr-link fr-icon-mail-line" href="/fr/contact/">Contact</a>
29+
</li>
30+
<li>
31+
<a class="fr-link fr-icon-rss-line" href="/feed/feed.json">Flux RSS</a>
3232
</li>
3333
</ul>
34-
{% include "components/translate.njk" %}
3534
</div>
3635
</div>
3736
</div>

_includes/components/navigation.njk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{# Works with eleventyNavigation #}
22
<nav class="fr-nav" id="navigation-494" role="navigation" aria-label="{{ "main_menu" | i18n }}">
3-
{% set navigationLinks = collections.all | filterCollectionLang(lang) | eleventyNavigation %}
3+
{% set navigationLinks = collections.all | filterCollectionLang | eleventyNavigation %}
44
<ul class="fr-nav__list">
55
{% for link in navigationLinks %}
66
{% set link_url = link.url | locale_url(lang) %}
77
<li class="fr-nav__item">
88
{% if not link.children | length %}
99
<a class="fr-nav__link" href="{{ link_url }}"
10-
target="_self"{% if link_url == page.url %} aria-current="page"{% endif %}>{{ link.title }}</a>
10+
{% if link_url == page.url %} aria-current="page"{% endif %}>{{ link.title }}</a>
1111
{% else %}
1212
<button class="fr-nav__btn" aria-expanded="false" aria-controls="menu-{{ loop.index }}">
1313
{{ link.key }}</button>
1414
<div class="fr-collapse fr-menu" id="menu-{{ loop.index }}">
1515
<ul class="fr-menu__list">
1616
<li>
1717
<a class="fr-nav__link" href="{{ link_url }}"
18-
target="_self"{% if link_url == page.url %} aria-current="page"{% endif %}>{{ link.title }}</a>
18+
{% if link_url == page.url %} aria-current="page"{% endif %}>{{ link.title }}</a>
1919
</li>
2020
{% for sublink in link.children %}
2121
<li>
22-
{% set sublink_url = sublink.url | locale_url(lang) %}
23-
<a class="fr-nav__link" href="{{ sublink_url }}"
24-
target="_self"{% if sublink_url == page.url %} aria-current="page"{% endif %}>{{ sublink.title }}</a>
22+
{% set sublink_url = sublink.url | locale_url(lang) or sublink.external_url %}
23+
<a class="fr-nav__link"
24+
href="{{ sublink_url }}" {% if sublink.external_url %} target="_blank"{% endif %}{% if sublink_url == page.url %} aria-current="page"{% endif %}>{{ sublink.title }}</a>
2525
</li>
2626
{% endfor %}
2727
</ul>

0 commit comments

Comments
 (0)