From 535acb34613b5cf7e22654619f4337b94b70644d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 12 Jun 2023 16:35:38 -0300 Subject: content: cut html.template boilerplate --- src/content/dependencies/generateContentHeading.js | 34 +++++++++------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'src/content/dependencies/generateContentHeading.js') diff --git a/src/content/dependencies/generateContentHeading.js b/src/content/dependencies/generateContentHeading.js index 1666ef4b..ccaf1076 100644 --- a/src/content/dependencies/generateContentHeading.js +++ b/src/content/dependencies/generateContentHeading.js @@ -1,27 +1,19 @@ export default { - extraDependencies: [ - 'html', - ], + extraDependencies: ['html'], - generate({html}) { - return html.template({ - annotation: 'generateContentHeading', + slots: { + title: {type: 'html'}, + id: {type: 'string'}, + tag: {type: 'string', default: 'p'}, + }, - slots: { - title: {type: 'html'}, - id: {type: 'string'}, - tag: {type: 'string', default: 'p'}, + generate(slots, {html}) { + return html.tag(slots.tag, + { + class: 'content-heading', + id: slots.id, + tabindex: '0', }, - - content(slots) { - return html.tag(slots.tag, - { - class: 'content-heading', - id: slots.id, - tabindex: '0', - }, - slots.title); - }, - }); + slots.title); } } -- cgit 1.3.0-6-gf8a5