diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-06-12 13:34:53 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-06-18 22:56:08 -0300 |
commit | 447e981001f9ed606f3ccb14a66a5bb7d11fcbf3 (patch) | |
tree | 86df0ceca11d5cfcd3969c2c3e69e7e0b2f088e5 /src/content | |
parent | 70fe734841a7e95f7d7959f1d74d74abe5a1fd31 (diff) |
content: generateContributionList: blank if no contributions
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/dependencies/generateContributionList.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/content/dependencies/generateContributionList.js b/src/content/dependencies/generateContributionList.js index 6401e65e..0c4ef87a 100644 --- a/src/content/dependencies/generateContributionList.js +++ b/src/content/dependencies/generateContributionList.js @@ -2,17 +2,20 @@ export default { contentDependencies: ['linkContribution'], extraDependencies: ['html'], - relations: (relation, contributions) => - ({contributionLinks: - contributions - .map(contrib => relation('linkContribution', contrib))}), + relations: (relation, contributions) => ({ + contributionLinks: + contributions + .map(contrib => relation('linkContribution', contrib)), + }), generate: (relations, {html}) => html.tag('ul', - relations.contributionLinks.map(contributionLink => - html.tag('li', - contributionLink - .slots({ + {[html.onlyIfContent]: true}, + + relations.contributionLinks + .map(contributionLink => + html.tag('li', + contributionLink.slots({ showIcons: true, showContribution: true, preventWrapping: false, |