From 3fb01a3022a3f47c0e1e6e76771a35fce23a128b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 29 Dec 2023 23:58:38 -0400 Subject: content: generateColorStyleAttribute --- src/content/dependencies/generateGroupSecondaryNav.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/content/dependencies/generateGroupSecondaryNav.js') diff --git a/src/content/dependencies/generateGroupSecondaryNav.js b/src/content/dependencies/generateGroupSecondaryNav.js index 43c78a0f..c649e300 100644 --- a/src/content/dependencies/generateGroupSecondaryNav.js +++ b/src/content/dependencies/generateGroupSecondaryNav.js @@ -1,6 +1,6 @@ export default { contentDependencies: [ - 'generateColorStyleVariables', + 'generateColorStyleAttribute', 'generatePreviousNextLinks', 'generateSecondaryNav', 'linkGroupDynamically', @@ -34,7 +34,7 @@ export default { }; }, - relations(relation, query, sprawl, _group) { + relations(relation, query, sprawl, group) { const relations = {}; relations.secondaryNav = @@ -45,8 +45,8 @@ export default { relation('linkListing', sprawl.groupsByCategoryListing); } - relations.colorVariables = - relation('generateColorStyleVariables'); + relations.colorStyle = + relation('generateColorStyleAttribute', group.category.color); if (query.previousGroup || query.nextGroup) { relations.previousNextLinks = @@ -68,7 +68,6 @@ export default { data: (query, sprawl, group) => ({ categoryName: group.category.name, - categoryColor: group.category.color, }), generate(data, relations, {html, language}) { @@ -89,10 +88,7 @@ export default { (!relations.previousGroupLink && !relations.nextGroupLink ? categoryLink : html.tag('span', - {style: - relations.colorVariables - .slot('color', data.categoryColor) - .content}, + relations.colorStyle, [ categoryLink.slot('color', false), -- cgit 1.3.0-6-gf8a5