Skip to content

Commit

Permalink
changements layout
Browse files Browse the repository at this point in the history
  • Loading branch information
slafayIGN committed Jan 26, 2024
1 parent c636d38 commit 7ec41ff
Show file tree
Hide file tree
Showing 29 changed files with 220 additions and 209 deletions.
2 changes: 1 addition & 1 deletion _data/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ const buildTranslations = () => {

module.exports = {
availableLang: langDirectories,
...buildTranslations()
translations: buildTranslations()
};
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
50 changes: 28 additions & 22 deletions _includes/components/card.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if not card %}{% set card = params %}{% endif %}
<div class="fr-card{% if not card.externalUrl %} fr-enlarge-link{% endif %}{% if card.orientation == 'horizontal' %} fr-card--horizontal-tier{% endif %}">
<div class="fr-card{% if not card.externalUrl %} fr-enlarge-link{% endif %} {{ card.addClass }}">
<div class="fr-card__body">
<div class="fr-card__content">
{% set cardUrl = card.url | locale_url or card.externalUrl %}
Expand All @@ -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,32 +23,38 @@
{{ card.date | readableDate }}
</time>
</p>
{% elif card.detail %}
<p class="fr-card__detail">{{ card.detail }}</p>
{% endif %}
</div>
</div>
<div class="fr-card__footer">
{% if card.externalUrl %}
<ul class="fr-links-group">
<li>
<a class="fr-link fr-icon-arrow-right-line fr-link--icon-right" href="{{ card.externalUrl }}"
title="{{ card.title }} - {{ "new_window" | i18n }}" target="_blank" rel="noopener">
{{ card.urlDescription or "see_more" | i18n }}
</a>
</li>
</ul>
<a class="fr-link fr-icon-arrow-right-line fr-link--icon-right" href="{{ card.externalUrl }}"
title="{{ card.title }} - {{ "new_window" | i18n }}" target="_blank" rel="noopener">
{{ card.urlDescription or "see_more" | i18n }}
</a>
{% endif %}
</div>
</div>
<div class="fr-card__header">
{% if card.badges %}
<ul class="fr-badges-group">
{% for badge in card.badges %}
<li><p class="fr-badge fr-badge--green-emeraude">{{ badge }}</p></li>
{% endfor %}
</ul>
{% endif %}
{% if card.image.path %}
<div class="fr-card__img">{% imageSync card.image.path, card.image.alt %}</div>
{% endif %}
</div>
{% if card.badges or card.image %}
<div class="fr-card__header">
{% if card.badges %}
<ul class="fr-badges-group">
{% for badge in card.badges %}
<li><p class="fr-badge fr-badge--green-emeraude">{{ badge }}</p></li>
{% endfor %}
</ul>
{% endif %}
{% if card.image %}
{% if card.image.path %}
<div class="fr-card__img">{% imageSync card.image.path, card.image.alt %}</div>
{% elif card.image.src %}
<div class="fr-card__img">
<img class="fr-responsive-img fr-responsive-img--1x1" src="{{ card.image.src }}" alt="{{ card.image.alt }}">
</div>
{% endif %}
{% endif %}
</div>
{% endif %}
</div>
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>
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>
30 changes: 23 additions & 7 deletions _includes/layouts/page.njk
Original file line number Diff line number Diff line change
@@ -1,13 +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">
{{ 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>
42 changes: 3 additions & 39 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 Down Expand Up @@ -32,43 +32,7 @@ layout: layouts/base.njk
</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">
{{ nextPost.date | readableDate }}
</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 fr-col-md-4">
{% 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
30 changes: 30 additions & 0 deletions _includes/previousnextlinks.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% from "components/component.njk" import component with context %}
{% 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">
{{ component("card", {
url: previousPost.url,
title: previousPost.data.title,
date: previousPost.date,
addClass: "fr-card--horizontal-tier fr-card--grey fr-card--no-border fr-card--sm"
}) }}
</div>
{% endif %}
{% if nextPost %}
<div class="fr-col-12 fr-col-md-6">
{{ component("card", {
url: nextPost.url,
title: nextPost.data.title,
date: nextPost.date,
addClass: "fr-card--horizontal-tier fr-card--grey fr-card--no-border fr-card--sm"
}) }}
</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
13 changes: 7 additions & 6 deletions content/404.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Page non trouvée
permalink: 404.html
layout: layouts/page.njk
layout: layouts/base.njk
eleventyExcludeFromCollections: true
---
<div class="fr-container">
Expand Down Expand Up @@ -33,13 +34,13 @@ eleventyExcludeFromCollections: true
<div class="fr-col-12 fr-col-md-3 fr-col-offset-md-1 fr-px-6w fr-px-md-0 fr-py-0">
<svg xmlns="http://www.w3.org/2000/svg" class="fr-responsive-img fr-artwork" aria-hidden="true" width="160"
height="200" viewBox="0 0 160 200">
<use class="fr-artwork-motif" href="/artwork/background/ovoid.svg#artwork-motif"></use>
<use class="fr-artwork-background" href="/artwork/background/ovoid.svg#artwork-background"></use>
<use class="fr-artwork-motif" href="{{ "/artwork/background/ovoid.svg" | htmlBaseUrl }}#artwork-motif"></use>
<use class="fr-artwork-background" href="{{ "/artwork/background/ovoid.svg" | htmlBaseUrl }}#artwork-background"></use>
<g transform="translate(40, 60)">
<use class="fr-artwork-decorative"
href="/artwork/pictograms/system/technical-error.svg#artwork-decorative"></use>
<use class="fr-artwork-minor" href="/artwork/pictograms/system/technical-error.svg#artwork-minor"></use>
<use class="fr-artwork-major" href="/artwork/pictograms/system/technical-error.svg#artwork-major"></use>
href="{{ "/artwork/pictograms/system/technical-error.svg" | htmlBaseUrl }}#artwork-decorative"></use>
<use class="fr-artwork-minor" href="{{ "/artwork/pictograms/system/technical-error.svg" | htmlBaseUrl }}#artwork-minor"></use>
<use class="fr-artwork-major" href="{{ "/artwork/pictograms/system/technical-error.svg" | htmlBaseUrl }}#artwork-major"></use>
</g>
</svg>
</div>
Expand Down
2 changes: 1 addition & 1 deletion content/en/about/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: About
layout: layouts/page.njk
eleventyNavigation:
key: About
order: 3
---
# About

We are the mission logiciels libres.
19 changes: 8 additions & 11 deletions content/en/blog/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
title: "Blog",
pagination: {
data: "collections.posts",
size: 10,
size: 6,
reverse: true,
before: function(paginationData, fullData) {
return this.filterCollectionLang(paginationData, fullData.lang);
Expand All @@ -17,14 +17,11 @@
}
}
---
<h1>{{ title }}</h1>
<div class="fr-container">
<p class="fr-text--heavy fr-mb-3v">{{ "filter_by_tag" | i18n }}</p>
<div class="fr-mb-3w">
{% set tags = collections.posts | filterCollectionLang | getAllTags %}
{% include "components/taggroup.njk" %}
</div>
{% set postslist = pagination.items %}
{% include "postslist.njk" %}
{% include "templates/pagination.njk" %}
<h2 class="fr-h4">{{ "filter_by_tag" | i18n }}</h2>
<div class="fr-mt-6v fr-mb-6w">
{% set tags = collections.posts | filterCollectionLang | getAllTags %}
{% include "components/taggroup.njk" %}
</div>
{% set postslist = pagination.items %}
{% include "postslist.njk" %}
{% include "templates/pagination.njk" %}
Loading

0 comments on commit 7ec41ff

Please sign in to comment.