diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-04-08 16:54:39 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-04-08 16:54:39 -0300 |
commit | 776abf8d697716902692f357c6f179c1e681369f (patch) | |
tree | a75e7f63ffc13121c3c08f1f78c10bc883b4d4e1 /src/content/dependencies/generateContentHeading.js | |
parent | 0cbfa8c1b70080c7ec4eb352902cf76f8ef30fcf (diff) |
html: drastically simplify template/slot system
Diffstat (limited to 'src/content/dependencies/generateContentHeading.js')
-rw-r--r-- | src/content/dependencies/generateContentHeading.js | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/content/dependencies/generateContentHeading.js b/src/content/dependencies/generateContentHeading.js index baa52080..f5e4bd00 100644 --- a/src/content/dependencies/generateContentHeading.js +++ b/src/content/dependencies/generateContentHeading.js @@ -4,13 +4,23 @@ export default { ], generate({html}) { - return html.template(slot => - html.tag('p', - { - class: 'content-heading', - id: slot('id'), - tabindex: '0', - }, - slot('title'))); + return html.template({ + annotation: 'generateContentHeading', + + slots: { + title: {type: 'html'}, + id: {type: 'string'}, + }, + + content(slots) { + return html.tag('p', + { + class: 'content-heading', + id: slots.id, + tabindex: '0', + }, + slots.content); + }, + }); } } |