diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-06-12 16:35:38 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-06-12 16:35:38 -0300 |
commit | 535acb34613b5cf7e22654619f4337b94b70644d (patch) | |
tree | 5a713eb4f12eae7e1fe1aa60941709708585db32 /src/content/dependencies/generateStickyHeadingContainer.js | |
parent | 630af0a345f3be6c3e4aa3300ce138e48ed5ae91 (diff) |
content: cut html.template boilerplate
Diffstat (limited to 'src/content/dependencies/generateStickyHeadingContainer.js')
-rw-r--r-- | src/content/dependencies/generateStickyHeadingContainer.js | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/src/content/dependencies/generateStickyHeadingContainer.js b/src/content/dependencies/generateStickyHeadingContainer.js index 6602a2a3..e5f7cc5d 100644 --- a/src/content/dependencies/generateStickyHeadingContainer.js +++ b/src/content/dependencies/generateStickyHeadingContainer.js @@ -1,39 +1,33 @@ export default { extraDependencies: ['html'], - generate({html}) { - return html.template({ - annotation: `generateStickyHeadingContainer`, - - slots: { - title: {type: 'html'}, - cover: {type: 'html'}, - }, + slots: { + title: {type: 'html'}, + cover: {type: 'html'}, + }, - content(slots) { - const hasCover = !html.isBlank(slots.cover); + generate(slots, {html}) { + const hasCover = !html.isBlank(slots.cover); - return html.tag('div', - { - class: [ - 'content-sticky-heading-container', - hasCover && 'has-cover', - ], - }, - [ - html.tag('div', {class: 'content-sticky-heading-row'}, [ - html.tag('h1', slots.title), + return html.tag('div', + { + class: [ + 'content-sticky-heading-container', + hasCover && 'has-cover', + ], + }, + [ + html.tag('div', {class: 'content-sticky-heading-row'}, [ + html.tag('h1', slots.title), - hasCover && - html.tag('div', {class: 'content-sticky-heading-cover-container'}, - html.tag('div', {class: 'content-sticky-heading-cover'}, - slots.cover.slot('displayMode', 'thumbnail'))), - ]), + hasCover && + html.tag('div', {class: 'content-sticky-heading-cover-container'}, + html.tag('div', {class: 'content-sticky-heading-cover'}, + slots.cover.slot('displayMode', 'thumbnail'))), + ]), - html.tag('div', {class: 'content-sticky-subheading-row'}, - html.tag('h2', {class: 'content-sticky-subheading'})), - ]); - }, - }); + html.tag('div', {class: 'content-sticky-subheading-row'}, + html.tag('h2', {class: 'content-sticky-subheading'})), + ]); }, }; |