diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-06-14 18:56:50 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-06-14 18:57:06 -0300 |
commit | e4d2740a7c649246072e94067f99cda0829133aa (patch) | |
tree | c59ebe65f9fa58fd1bb89f066957d76a2652fec5 /src/content/dependencies/generateContentContentHeading.js | |
parent | d4a147cff78f25574b65068dcc2abc1c026eb3c8 (diff) |
content: generateContentContentHeading
Diffstat (limited to 'src/content/dependencies/generateContentContentHeading.js')
-rw-r--r-- | src/content/dependencies/generateContentContentHeading.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/content/dependencies/generateContentContentHeading.js b/src/content/dependencies/generateContentContentHeading.js new file mode 100644 index 00000000..35bb91e9 --- /dev/null +++ b/src/content/dependencies/generateContentContentHeading.js @@ -0,0 +1,39 @@ +export default { + contentDependencies: ['generateContentHeading'], + extraDependencies: ['html', 'language'], + + relations: (relation, _thing) => ({ + contentHeading: + relation('generateContentHeading'), + }), + + data: (thing) => ({ + name: + thing.name, + }), + + slots: { + attributes: { + type: 'attributes', + mutable: false, + }, + + string: { + type: 'string', + }, + }, + + generate: (data, relations, slots, {html, language}) => + relations.contentHeading.slots({ + attributes: slots.attributes, + + title: + language.$(slots.string, { + thing: + html.tag('i', data.name), + }), + + stickyTitle: + language.$(slots.string, 'sticky'), + }), +} |