Skip to content

Commit

Permalink
gh-18 Mention sponsoring agencies on awesome page
Browse files Browse the repository at this point in the history
  • Loading branch information
hjonin committed Feb 7, 2024
1 parent 637b12e commit 153f845
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions _includes/components/card.njk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<p class="fr-card__detail">{{ card.detail }}</p>
{% endif %}
</div>
{% if card.detailEnd %}
<div class="fr-card__end">
<p class="fr-card__detail">{{ card.detailEnd }}</p>
</div>
{% endif %}
</div>
<div class="fr-card__footer">
{% if card.externalUrl %}
Expand Down
8 changes: 6 additions & 2 deletions content/fr/awesome/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ eleventyNavigation:
<div class="fr-my-6w">
<div class="fr-grid-row fr-grid-row--gutters">
{% asyncAll project in awesome %}
{% set projectBadgeLink %}
<a class="fr-link link-no-style" href="https://github.com/codegouvfr/awesome-codegouvfr#awesome-codegouvfr-score" target="_blank"><img src="{{ project.awesomeShield }}" alt="Badge Awesome CodeGouvFr du projet {{ project.name }}"></a>
{% endset %}
<div class="fr-col-12 fr-col-md-3">
{{ component("card", {
url: false,
Expand All @@ -23,9 +26,10 @@ eleventyNavigation:
description: project.description.fr.shortDescription,
image: {
src: project.logo,
alt: "Logo du projet"
alt: "Logo du projet " + project.name
},
detail: ('<a class="fr-link link-no-style" href="https://github.com/codegouvfr/awesome-codegouvfr#awesome-codegouvfr-score" target="_blank"><img src="' + project.awesomeShield + '" alt="Badge Awesome CodeGouvFr du projet"></a>') | safe
detail: projectBadgeLink | safe,
detailEnd: project.fundedBy | pluck("name") | join(", ")
}) }}
</div>
{% endall %}
Expand Down
4 changes: 4 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ module.exports = function (eleventyConfig) {
return collection.find(post => post.fileSlug === slug);
});

eleventyConfig.addFilter("pluck", (arr, key) => {
return arr.map(item => item[key]);
});

// Customize Markdown library settings:
eleventyConfig.amendLibrary("md", mdLib => {
mdLib.use(markdownItAnchor, {
Expand Down

0 comments on commit 153f845

Please sign in to comment.