Sponsor component

This commit is contained in:
Yves Gatesoupe 2020-07-16 00:11:48 +02:00
parent 783d46cb82
commit 7510969eeb
12 changed files with 74 additions and 2 deletions

View File

@ -71,6 +71,11 @@ module.exports = function(config) {
return [...collection.getFilteredByGlob("./src/members/*.md")] return [...collection.getFilteredByGlob("./src/members/*.md")]
.slice(0, site.maxProfilePreview); .slice(0, site.maxProfilePreview);
}); });
config.addCollection('customers', collection => {
return [...collection.getFilteredByGlob("./src/customers/*.md")]
.reverse()
.slice(0, site.maxSponsorPerPage);
});
// Plugins // Plugins
config.addPlugin(rssPlugin); config.addPlugin(rssPlugin);

View File

@ -20,5 +20,6 @@
"maxPostsPerPage": 5, "maxPostsPerPage": 5,
"maxNewsPerPage": 4, "maxNewsPerPage": 4,
"maxProfilePreview": 3, "maxProfilePreview": 3,
"maxSponsorPerPage": 4,
"faviconPath": "/images/favicon.png" "faviconPath": "/images/favicon.png"
} }

View File

@ -3,6 +3,7 @@
{# Set lists content #} {# Set lists content #}
{% set newsListHeading = newsHeading %} {% set newsListHeading = newsHeading %}
{% set newsListItems = collections.newsFeed %} {% set newsListItems = collections.newsFeed %}
{% set customersListItems = collections.customers %}
{% block content %} {% block content %}
<main id="main-content" class="home" tabindex="-1"> <main id="main-content" class="home" tabindex="-1">

View File

@ -1,3 +1,16 @@
<section> <section class="[ sponsor ]">
<div style="background-color: #f1f0f6; height: 14rem;"></div> <div class="[ wrapper ]">
<p class="[ sponsor__heading ]">Ils nous font confiance</p>
{% if customersListItems.length %}
<ol class="[ sponsor__list ]">
{% for item in customersListItems %}
<li class="sponsor__list-item">
<a href="{{ item.data.url }}" title="{{ item.data.name }}" target="_blank">
<img src="{{ item.data.thumbnail }}" alt="logo de {{ item.data.name }}">
</a>
</li>
{% endfor %}
</ol>
{% endif %}
</div>
</section> </section>

View File

@ -0,0 +1,5 @@
---
name: 'Le Web en plus'
thumbnail: '/images/customers/logo-lewebenplus.png'
url: 'https://www.lewebenplus.net/'
---

5
src/customers/naega.md Normal file
View File

@ -0,0 +1,5 @@
---
name: 'Naega'
thumbnail: '/images/customers/logo-naega.png'
url: 'https://www.crealead.com/naega'
---

View File

@ -0,0 +1,5 @@
---
name: 'Technicolor'
thumbnail: '/images/customers/logo-technicolor.png'
url: 'https://www.technicolor.com/'
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -0,0 +1,36 @@
.sponsor {
background-color: var(--color-light-gray);
.wrapper {
display: flex;
flex-direction: column;
}
&__heading {
align-self: center;
text-transform: uppercase;
font-size: 1.125rem;
font-weight: 300;
margin: 1.5rem 0 3rem;
}
&__list {
list-style: none;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: 1fr;
grid-column-gap: 1.5rem;
grid-row-gap: 0;
}
&__list-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
img {
max-width: 8rem;
}
}
}

View File

@ -77,6 +77,7 @@ img {
@import 'components/presentation'; @import 'components/presentation';
@import 'components/site-head'; @import 'components/site-head';
@import 'components/site-foot'; @import 'components/site-foot';
@import 'components/sponsor';
@import 'components/skip-link'; @import 'components/skip-link';
@import 'components/syntax-highlighting'; @import 'components/syntax-highlighting';
@import 'components/video-player'; @import 'components/video-player';