diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-06-12 13:34:53 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-06-12 17:32:57 -0300 |
commit | 0902c43c7be3552ce2d61981a58f21791df5f45f (patch) | |
tree | af646a7e67f58b6e8f40b898ea7ad18811bdaa89 | |
parent | 01417566d7772f7a678c321baf3dd527498844a4 (diff) |
content: generateContributionList: blank if no contributions
-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, |