Skip to content

Commit

Permalink
Merge branch 'main' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
bzg committed Jan 26, 2024
2 parents d56c612 + 1c19df8 commit e6f253f
Show file tree
Hide file tree
Showing 47 changed files with 593 additions and 634 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@ Le contenu rédactionnel du site est une publication DINUM, 20 avenue de Ségur,

### Crédits images

- [Gradient icons created by srip](https://www.flaticon.com/authors/srip/gradient)
- hat by sripfoto from [Noun Project](https://thenounproject.com/srip/) (CC BY 3.0)
- [Programmer.png](public/illustrations/Programmer.png) par ven sur [IllustrationKit](https://illustrationkit.com/illustrations/ven)
- [Blank_man_placeholder.svg](https://fr.wikipedia.org/wiki/Fichier:Blank_man_placeholder.svg) par [AntoFran](https://commons.wikimedia.org/wiki/User:AntoFran) sous licence [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0>).

2 changes: 1 addition & 1 deletion _includes/components/callout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="fr-callout">
<h3 class="fr-callout__title">{{ callout.title }}</h3>
<p class="fr-callout__text">
{{ callout.description | safe }}
{{ callout.description }}
</p>
{% if callout.link %}
<a class="fr-btn" href="{{ callout.link.url }}">
Expand Down
10 changes: 5 additions & 5 deletions _includes/components/card.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% else %}{{ card.title }}
{% endif %}
</h3>
<p class="fr-card__desc">{{ card.description | safe }}</p>
<p class="fr-card__desc">{{ card.description }}</p>
<div class="fr-card__start">
{% if card.tags %}
{% set tags = card.tags %}
Expand All @@ -23,8 +23,8 @@
{{ card.date | readableDate }}
</time>
</p>
{% elif card.detail %}
{{ card.detail | safe }}
{% elif card.detail %}
<p class="fr-card__detail">{{ card.detail }}</p>
{% endif %}
</div>
</div>
Expand All @@ -47,9 +47,9 @@
{% endif %}
{% if card.image.path %}
<div class="fr-card__img">{% imageSync card.image.path, card.image.alt %}</div>
{% elif card.image.url %}
{% elif card.image.src %}
<div class="fr-card__img">
<img class="fr-responsive-img fr-responsive-img--1x1" src="{{ card.image.url }}" alt="{{ card.image.alt }}">
<img class="fr-responsive-img fr-responsive-img--1x1" src="{{ card.image.src }}" alt="{{ card.image.alt }}">
</div>
{% endif %}
</div>
Expand Down
33 changes: 21 additions & 12 deletions _includes/components/tile.njk
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
{% if not tile %}{% set tile = params %}{% endif %}
<div class="fr-tile fr-enlarge-link">
<div class="fr-tile__body">
{% set tileUrl = tile.url | locale_url or tile.externalUrl %}
{% set urlDescription %}{{ tile.title }}{% if tile.externalUrl %} - {{ "new_window" | i18n }}{% endif %}{% endset %}
<h4 class="fr-tile__title">
<a class="fr-tile__link" href="{{ tileUrl }}"
title="{{ urlDescription }}"{% if tile.externalUrl %} target="_blank" rel="noopener"{% endif %}>
{{ tile.title }}
</a>
</h4>
<p class="fr-tile__desc">{{ tile.description | safe }}</p>
<div class="fr-tile__content">
{% set tileUrl = tile.url | locale_url or tile.externalUrl %}
{% set urlDescription %}{{ tile.title }}{% if tile.externalUrl %} - {{ "new_window" | i18n }}{% endif %}{% endset %}
<h4 class="fr-tile__title">
<a class="fr-tile__link" href="{{ tileUrl }}"
title="{{ urlDescription }}"{% if tile.externalUrl %} target="_blank" rel="noopener"{% endif %}>
{{ tile.title }}
</a>
</h4>
<p class="fr-tile__desc">{{ tile.description }}</p>
</div>
</div>
{% if tile.imageSrc %}
<div class="fr-tile__img">
<img src="{{ tile.imageSrc }}" alt="" class="fr-responsive-img">
{% if tile.pictogram %}
<div class="fr-tile__header">
<div class="fr-tile__pictogram">
{% set pictogramUrl = "/artwork/pictograms/" + tile.pictogram %}
<svg aria-hidden="true" class="fr-artwork" viewBox="0 0 80 80" width="80px" height="80px">
<use class="fr-artwork-decorative" href="{{ pictogramUrl | htmlBaseUrl }}#artwork-decorative"></use>
<use class="fr-artwork-minor" href="{{ pictogramUrl | htmlBaseUrl }}#artwork-minor"></use>
<use class="fr-artwork-major" href="{{ pictogramUrl | htmlBaseUrl }}#artwork-major"></use>
</svg>
</div>
</div>
{% endif %}
</div>
46 changes: 4 additions & 42 deletions _includes/layouts/bluehats-post.njk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: layouts/base.njk
---
<div class="fr-container fr-py-8v">
<div class="fr-container fr-py-6w">
{% if showBreadcrumb %}
{% include "components/breadcrumb.njk" %}
{% endif %}
Expand All @@ -26,7 +26,7 @@ layout: layouts/base.njk

{% if description %}
<p class="fr-text--lead">
{{ description | safe }}
{{ description }}
</p>
{% endif %}

Expand Down Expand Up @@ -55,45 +55,7 @@ layout: layouts/base.njk
</div>

{% if collections.bluehats_posts %}
{% set previousPost = collections.bluehats_posts | filterCollectionLang | getPreviousCollectionItem %}
{% set nextPost = collections.bluehats_posts | filterCollectionLang | getNextCollectionItem %}
{% if nextPost or previousPost %}
<h2>{{ "read_also" | i18n }}</h2>
<div class="fr-grid-row fr-grid-row--gutters fr-mb-12v">
{% if previousPost %}
<div class="fr-col-12 fr-col-md-6">
<div class="fr-card fr-enlarge-link fr-card--grey fr-card--no-border">
<div class="fr-card__body">
<p class="fr-card__detail fr-icon-time-fill">
<time datetime="{{ previousPost.date | htmlDateString }}">
{{ previousPost.date | readableDate }}
</time>
</p>
<h4 class="fr-card__title">
<a href="{{ previousPost.url }}" class="fr-card__link">{{ previousPost.data.title }}</a>
</h4>
</div>
</div>
</div>
{% endif %}
{% if nextPost %}
<div class="fr-col-12 fr-col-md-6">
<div class="fr-card fr-enlarge-link fr-card--grey fr-card--no-border">
<div class="fr-card__body">
<p class="fr-card__detail fr-icon-time-fill">
<time datetime="{{ nextPost.date | htmlDateString }}">
{{ nextPost.date | readableDate }}
</time>
</p>
<h4 class="fr-card__title">
<a href="{{ nextPost.url }}" class="fr-card__link">{{ nextPost.data.title }}</a>
</h4>
</div>
</div>
</div>
{% endif %}
</div>
{% endif %}
{% set currentPosts = collections.bluehats_posts %}
{% include "previousnextlinks.njk" %}
{% endif %}

</div>
2 changes: 1 addition & 1 deletion _includes/layouts/home.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: layouts/base.njk
---
<div class="fr-container--fluid fr-pb-6w">
<div class="fr-mb-6w">
{{ content | safe }}
</div>
31 changes: 23 additions & 8 deletions _includes/layouts/page.njk
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
---
layout: layouts/base.njk
---
<div class="fr-container fr-py-8v">
{% if showBreadcrumb %}
{% include "components/breadcrumb.njk" %}
{% endif %}
<div class="fr-grid-row" data-pagefind-body>
<div class="fr-col-12">
{% if title %}<h1>{{ title }}</h1>{% endif %}
{{ content | safe }}
<div class="fr-mb-6w">
<div class="fr-py-6w fr-background-alt--blue-cumulus">
<div class="fr-container">
<div class="fr-grid-row">
<div class="fr-col-10">
{% if showBreadcrumb %}
{% include "components/breadcrumb.njk" %}
{% endif %}
<h1 class="fr-mt-6v">{{ title }}</h1>
{% if description %}
<p class="fr-text--lead">
{{ description }}
</p>
{% endif %}
</div>
</div>
</div>
</div>
<div class="fr-container fr-mt-6w" data-pagefind-body>
<div class="fr-grid-row">
<div class="fr-col-12">
{{ content | safe }}
</div>
</div>
</div>
</div>
50 changes: 6 additions & 44 deletions _includes/layouts/post.njk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: layouts/base.njk
---
<div class="fr-container fr-py-8v">
<div class="fr-container fr-py-6w">
{% if showBreadcrumb %}
{% include "components/breadcrumb.njk" %}
{% endif %}
Expand All @@ -24,55 +24,17 @@ layout: layouts/base.njk
</div>

{% if image %}
{% if not image.hide %}
{% imageContent image.path, image.alt %}
{% endif %}
{% if not image.hide %}
{% imageContent image.path, image.alt %}
{% endif %}
{% endif %}

{{ content | safe }}
</div>
</div>

{% if collections.posts %}
{% set previousPost = collections.posts | filterCollectionLang | getPreviousCollectionItem %}
{% set nextPost = collections.posts | filterCollectionLang | getNextCollectionItem %}
{% if nextPost or previousPost %}
<h2>{{ "read_also" | i18n }}</h2>
<div class="fr-grid-row fr-grid-row--gutters fr-mb-12v">
{% if previousPost %}
<div class="fr-col-12 fr-col-md-6">
<div class="fr-card fr-enlarge-link fr-card--grey fr-card--no-border">
<div class="fr-card__body">
<p class="fr-card__detail fr-icon-time-fill">
<time datetime="{{ previousPost.date | htmlDateString }}">
{{ previousPost.date | readableDate }}
</time>
</p>
<h4 class="fr-card__title">
<a href="{{ previousPost.url }}" class="fr-card__link">{{ previousPost.data.title }}</a>
</h4>
</div>
</div>
</div>
{% endif %}
{% if nextPost %}
<div class="fr-col-12 fr-col-md-6">
<div class="fr-card fr-enlarge-link fr-card--grey fr-card--no-border">
<div class="fr-card__body">
<p class="fr-card__detail fr-icon-time-fill">
<time datetime="{{ nextPost.date | htmlDateString }}">
{{ nextPost.date | readableDate }}
</time>
</p>
<h4 class="fr-card__title">
<a href="{{ nextPost.url }}" class="fr-card__link">{{ nextPost.data.title }}</a>
</h4>
</div>
</div>
</div>
{% endif %}
</div>
{% endif %}
{% set currentPosts = collections.posts %}
{% include "previousnextlinks.njk" %}
{% endif %}

</div>
4 changes: 2 additions & 2 deletions _includes/postslist.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="fr-grid-row fr-grid-row--gutters fr-mb-3w" data-pagefind-ignore>
<div class="fr-grid-row fr-grid-row--gutters fr-mb-6v" data-pagefind-ignore>
{% asyncAll post in postslist %}
<div class="fr-col-12">
{% from "components/component.njk" import component with context %}
{{ component("card", {
url: post.url,
title: post.data.title,
description: post.data.description,
description: post.data.description | safe,
tags: post.data.tags,
date: post.date,
badges: post.data.badges,
Expand Down
41 changes: 41 additions & 0 deletions _includes/previousnextlinks.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% set previousPost = currentPosts | filterCollectionLang | getPreviousCollectionItem %}
{% set nextPost = currentPosts | filterCollectionLang | getNextCollectionItem %}
{% if nextPost or previousPost %}
<div class="fr-my-6w">
<h2>{{ "read_also" | i18n }}</h2>
<div class="fr-grid-row fr-grid-row--gutters fr-mb-6w">
{% if previousPost %}
<div class="fr-col-12 fr-col-md-6">
<div class="fr-card fr-enlarge-link fr-card--grey fr-card--no-border">
<div class="fr-card__body">
<p class="fr-card__detail fr-icon-time-fill">
<time datetime="{{ previousPost.date | htmlDateString }}">
{{ previousPost.date | readableDate }}
</time>
</p>
<h4 class="fr-card__title">
<a href="{{ previousPost.url }}" class="fr-card__link">{{ previousPost.data.title }}</a>
</h4>
</div>
</div>
</div>
{% endif %}
{% if nextPost %}
<div class="fr-col-12 fr-col-md-6">
<div class="fr-card fr-enlarge-link fr-card--grey fr-card--no-border">
<div class="fr-card__body">
<p class="fr-card__detail fr-icon-time-fill">
<time datetime="{{ nextPost.date | htmlDateString }}">
{{ nextPost.date | readableDate }}
</time>
</p>
<h4 class="fr-card__title">
<a href="{{ nextPost.url }}" class="fr-card__link">{{ nextPost.data.title }}</a>
</h4>
</div>
</div>
</div>
{% endif %}
</div>
</div>
{% endif %}
18 changes: 9 additions & 9 deletions _includes/templates/display.njk
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<svg xmlns="http://www.w3.org/2000/svg" class="fr-artwork" width="80px"
height="80px" viewBox="0 0 80 80">
<use class="fr-artwork-decorative"
xlink:href="{{ "/artwork/light.svg#artwork-decorative" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/light.svg" | htmlBaseUrl }}#artwork-decorative"></use>
<use class="fr-artwork-minor"
xlink:href="{{ "/artwork/light.svg#artwork-minor" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/light.svg" | htmlBaseUrl }}#artwork-minor"></use>
<use class="fr-artwork-major"
xlink:href="{{ "/artwork/light.svg#artwork-major" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/light.svg" | htmlBaseUrl }}#artwork-major"></use>
</svg>
</div>
</div>
Expand All @@ -39,11 +39,11 @@
<svg xmlns="http://www.w3.org/2000/svg" class="fr-artwork" width="80px"
height="80px" viewBox="0 0 80 80">
<use class="fr-artwork-decorative"
xlink:href="{{ "/artwork/dark.svg#artwork-decorative" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/dark.svg" | htmlBaseUrl }}#artwork-decorative"></use>
<use class="fr-artwork-minor"
xlink:href="{{ "/artwork/dark.svg#artwork-minor" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/dark.svg" | htmlBaseUrl }}#artwork-minor"></use>
<use class="fr-artwork-major"
xlink:href="{{ "/artwork/dark.svg#artwork-major" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/dark.svg" | htmlBaseUrl }}#artwork-major"></use>
</svg>
</div>
</div>
Expand All @@ -57,11 +57,11 @@
<svg xmlns="http://www.w3.org/2000/svg" class="fr-artwork" width="80px"
height="80px" viewBox="0 0 80 80">
<use class="fr-artwork-decorative"
xlink:href="{{ "/artwork/system.svg#artwork-decorative" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/system.svg" | htmlBaseUrl }}#artwork-decorative"></use>
<use class="fr-artwork-minor"
xlink:href="{{ "/artwork/system.svg#artwork-minor" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/system.svg" | htmlBaseUrl }}#artwork-minor"></use>
<use class="fr-artwork-major"
xlink:href="{{ "/artwork/system.svg#artwork-major" | htmlBaseUrl }}"></use>
xlink:href="{{ "/artwork/system.svg" | htmlBaseUrl }}#artwork-major"></use>
</svg>
</div>
</div>
Expand Down
Loading

0 comments on commit e6f253f

Please sign in to comment.