From b8951d45ce5e2c7a59b0d16e116bfe84f8dc55ac Mon Sep 17 00:00:00 2001 From: Yves Gatesoupe Date: Tue, 9 Nov 2021 19:24:23 +0100 Subject: [PATCH] Filter skills by tags --- .eleventy.js | 22 +++++++++++++ src/_includes/layouts/member.njk | 13 ++++++++ src/_includes/layouts/team.njk | 6 ++++ .../partials/components/member-list.njk | 4 +-- src/members/florent-le-saout.md | 5 +++ src/members/vincent-genieux.md | 1 + src/members/yves-gatesoupe.md | 7 ++++ src/pages/comprendre-la-cae.md | 1 + src/pages/contact.md | 1 + src/pages/equipe.md | 2 ++ src/pages/nous-rejoindre.md | 1 + src/pages/posts-events.md | 1 + src/pages/posts-news.md | 1 + src/pages/posts.md | 1 + src/pages/thank-you.md | 1 + src/scss/_theme.scss | 12 +++++++ src/scss/components/_form.scss | 1 + src/scss/components/_member-list.scss | 2 -- src/scss/components/_tags.scss | 21 ++++++++++++ src/scss/global.scss | 1 + src/team-skills.njk | 33 +++++++++++++++++++ 21 files changed, 132 insertions(+), 5 deletions(-) create mode 100644 src/scss/components/_tags.scss create mode 100644 src/team-skills.njk diff --git a/.eleventy.js b/.eleventy.js index 0c0e491..869a91c 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -74,6 +74,28 @@ module.exports = function(config) { .slice(0, site.maxProfilePreview) ; }); + config.addCollection("tagsList", function(collectionApi) { + const tagsList = new Set(); + collectionApi.getAll().map( item => { + if (item.data.tags) { // handle pages that don't have tags + item.data.tags.map( tag => tagsList.add(tag)) + } + }); + return tagsList; + }); + config.addCollection("skillsList", function(collectionApi) { + const skillsList = new Set(); + collectionApi.getFilteredByGlob("./src/members/*.md").map( item => { + if (item.data.tags) { // handle pages that don't have skills + item.data.tags.map( skill => { // exclude non related tags + if (['post', 'news', 'event'].indexOf(skill) == -1) { + skillsList.add(skill) + } + }) + } + }); + return skillsList; + }); config.addCollection('customers', collection => { return [...collection.getFilteredByGlob("./src/customers/*.md")] .reverse() diff --git a/src/_includes/layouts/member.njk b/src/_includes/layouts/member.njk index 44ed7f7..d8c7d97 100644 --- a/src/_includes/layouts/member.njk +++ b/src/_includes/layouts/member.njk @@ -29,9 +29,22 @@ {% if socialLinkedin %} {% endif %} +
{{ content | safe }} + {% if tags %} +

Mots-clés

+ + {% endif %}
diff --git a/src/_includes/layouts/team.njk b/src/_includes/layouts/team.njk index 0e5dcc8..564905a 100644 --- a/src/_includes/layouts/team.njk +++ b/src/_includes/layouts/team.njk @@ -7,6 +7,12 @@

{{ teamListHeading }}

{{ content | safe }} +

{{ tagSearchHeading }}

+
{% include "partials/components/member-list.njk" %} {% include "partials/components/contact-form.njk" %} diff --git a/src/_includes/partials/components/member-list.njk b/src/_includes/partials/components/member-list.njk index 130420c..61b9739 100644 --- a/src/_includes/partials/components/member-list.njk +++ b/src/_includes/partials/components/member-list.njk @@ -4,9 +4,7 @@
    {% for item in teamListItems %}
  1. - {#
    #} - photo de {{ item.data.name }} - {#
    #} + photo de {{ item.data.name }} {{ item.data.name }}  diff --git a/src/members/florent-le-saout.md b/src/members/florent-le-saout.md index f6805f0..5431c80 100644 --- a/src/members/florent-le-saout.md +++ b/src/members/florent-le-saout.md @@ -9,6 +9,11 @@ socialTwitter: 'https://twitter.com/AstrolabeCae' socialLinkedin: 'https://www.linkedin.com/company/astrolabe-cae' socialMastodon: 'https://framapiaf.org/@AstrolabeCAE' url: '/members/florent-le-saout' +tags: + - linux + - dev +skills: + - C++ --- Je suis co-fondateur et co-gérant de la SCOP CAE Astrolabe. diff --git a/src/members/vincent-genieux.md b/src/members/vincent-genieux.md index cb1776d..b8dd90f 100644 --- a/src/members/vincent-genieux.md +++ b/src/members/vincent-genieux.md @@ -9,6 +9,7 @@ socialTwitter: 'https://twitter.com/AstrolabeCae' socialLinkedin: 'https://www.linkedin.com/in/vincent-g%C3%A9nieux-4223982/' socialMastodon: 'https://framapiaf.org/@AstrolabeCAE' url: '/members/vincent-genieux' +tags: [ linux, dev ] --- ### Co-fondateur et co-gérant d'Astrolabe diff --git a/src/members/yves-gatesoupe.md b/src/members/yves-gatesoupe.md index 749c17a..455a9d8 100644 --- a/src/members/yves-gatesoupe.md +++ b/src/members/yves-gatesoupe.md @@ -8,6 +8,13 @@ personalSite: 'https://www.behance.net/ygates' socialTwitter: 'https://twitter.com/YGdsgn' socialLinkedin: 'https://www.linkedin.com/in/yves-gatesoupe-05990b17a/' url: '/members/yves-gatesoupe' +tags: + - html + - design + - dev +skills: + - dev + - Vue.js --- Je suis designer web indépendant depuis janvier 2020. diff --git a/src/pages/comprendre-la-cae.md b/src/pages/comprendre-la-cae.md index 1f2af9d..316f2dc 100644 --- a/src/pages/comprendre-la-cae.md +++ b/src/pages/comprendre-la-cae.md @@ -1,6 +1,7 @@ --- title: 'Comprendre la CAE' permalink: '/comprendre-la-cae/index.html' +eleventyExcludeFromCollections: true --- # Une entreprise partagée diff --git a/src/pages/contact.md b/src/pages/contact.md index 69287bf..e16b627 100644 --- a/src/pages/contact.md +++ b/src/pages/contact.md @@ -2,6 +2,7 @@ title: 'Contact' permalink: '/contact/index.html' layout: 'layouts/contact.njk' +eleventyExcludeFromCollections: true --- You can have a contact page which uses a basic form. The [code with the form fields lives here](https://github.com/hankchizljaw/hylia/blob/master/src/_includes/layouts/contact.njk). diff --git a/src/pages/equipe.md b/src/pages/equipe.md index 10967eb..f6e55a6 100644 --- a/src/pages/equipe.md +++ b/src/pages/equipe.md @@ -3,6 +3,8 @@ title: 'L''équipe Astrolabe' permalink: '/equipe/index.html' layout: 'layouts/team.njk' teamListHeading: 'L''équipe Astrolabe' +tagSearchHeading: 'Filter par mots-clés :' +eleventyExcludeFromCollections: true --- Astrolabe CAE est confondée par Florent Le Saout et Vincent Génieux en 2019.
    diff --git a/src/pages/nous-rejoindre.md b/src/pages/nous-rejoindre.md index 34a6f2f..1ba2b51 100644 --- a/src/pages/nous-rejoindre.md +++ b/src/pages/nous-rejoindre.md @@ -1,6 +1,7 @@ --- title: 'Nous rejoindre' permalink: '/nous-rejoindre/index.html' +eleventyExcludeFromCollections: true --- # Comment rejoindre Astrolabe diff --git a/src/pages/posts-events.md b/src/pages/posts-events.md index 6babb53..786974b 100644 --- a/src/pages/posts-events.md +++ b/src/pages/posts-events.md @@ -3,6 +3,7 @@ title: 'Actualité & Évènements' permalink: '/posts-events/index.html' layout: 'layouts/posts-events.njk' pageHeading: 'Actualité & Évènements' +eleventyExcludeFromCollections: true --- diff --git a/src/pages/posts-news.md b/src/pages/posts-news.md index 32e7e00..975f84b 100644 --- a/src/pages/posts-news.md +++ b/src/pages/posts-news.md @@ -3,6 +3,7 @@ title: 'Actualité & Évènements' permalink: '/posts-news/index.html' layout: 'layouts/posts-news.njk' pageHeading: 'Actualité & Évènements' +eleventyExcludeFromCollections: true --- diff --git a/src/pages/posts.md b/src/pages/posts.md index a7557b2..1eed3a2 100644 --- a/src/pages/posts.md +++ b/src/pages/posts.md @@ -3,6 +3,7 @@ title: 'Actualité & Évènements' permalink: '/posts/index.html' layout: 'layouts/posts.njk' pageHeading: 'Actualité & Évènements' +eleventyExcludeFromCollections: true --- diff --git a/src/pages/thank-you.md b/src/pages/thank-you.md index 590a28d..25392ef 100644 --- a/src/pages/thank-you.md +++ b/src/pages/thank-you.md @@ -1,6 +1,7 @@ --- title: 'Thank you' permalink: '/thank-you/index.html' +eleventyExcludeFromCollections: true --- # Merci ! diff --git a/src/scss/_theme.scss b/src/scss/_theme.scss index 86522b2..1826818 100644 --- a/src/scss/_theme.scss +++ b/src/scss/_theme.scss @@ -60,3 +60,15 @@ a:not([class]):visited { color: inherit; } } + +.justify-end { + justify-content: flex-end; +} + +.mt-1 { + margin-top: 1rem; +} + +.mt-2 { + margin-top: 2rem; +} diff --git a/src/scss/components/_form.scss b/src/scss/components/_form.scss index 496c62c..df0cef9 100644 --- a/src/scss/components/_form.scss +++ b/src/scss/components/_form.scss @@ -5,6 +5,7 @@ } .form-container { + margin-top: 8rem; padding: 0 0 6rem; background-color: var(--color-primary); color: var(--color-dark); diff --git a/src/scss/components/_member-list.scss b/src/scss/components/_member-list.scss index a31b545..f46e881 100644 --- a/src/scss/components/_member-list.scss +++ b/src/scss/components/_member-list.scss @@ -1,6 +1,4 @@ .member-list { - margin-bottom: 8rem; - &__heading { margin: 8rem 0 4rem; } diff --git a/src/scss/components/_tags.scss b/src/scss/components/_tags.scss new file mode 100644 index 0000000..9e62ba0 --- /dev/null +++ b/src/scss/components/_tags.scss @@ -0,0 +1,21 @@ +.tag-list { + list-style: none; + display: flex; + + .tag-item + .tag-item { + margin-left: 1rem; + } +} + +.tag-item { + padding: .5rem 1rem; + background-color: var(--color-light-gray); + + a { + text-decoration: none; + + &:hover { + text-decoration: underline; + } + } +} diff --git a/src/scss/global.scss b/src/scss/global.scss index b2226d2..c5545d3 100644 --- a/src/scss/global.scss +++ b/src/scss/global.scss @@ -75,4 +75,5 @@ img { @import 'components/partner'; @import 'components/skip-link'; @import 'components/video-player'; +@import 'components/tags'; @import 'utilities/responsive'; diff --git a/src/team-skills.njk b/src/team-skills.njk new file mode 100644 index 0000000..29e9516 --- /dev/null +++ b/src/team-skills.njk @@ -0,0 +1,33 @@ +--- +title: 'L''équipe Astrolabe' +pagination: + data: collections + size: 1 + alias: tag + filter: + - post + - news + - event + - customer + - partner +permalink: /equipe/{{ tag }}/ +--- + +{% extends 'layouts/base.njk' %} + +{% set teamListItems = collections[tag] %} + +{% block content %} +
    +
    +

    {{ teamListHeading }}

    + {{ content | safe }} +

    Profils par mot-clé : {{ tag }}

    +
    + {% include "partials/components/member-list.njk" %} + + {% include "partials/components/contact-form.njk" %} +
    +{% endblock %}