From b657f641c89ceee7676dc6d29fe4b9a168a97266 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 15 Oct 2024 23:17:20 -0300 Subject: content: generateInterpageDotSwitcher (stub) Not used anywhere for the time being --- .../dependencies/generateInterpageDotSwitcher.js | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/content/dependencies/generateInterpageDotSwitcher.js (limited to 'src/content') diff --git a/src/content/dependencies/generateInterpageDotSwitcher.js b/src/content/dependencies/generateInterpageDotSwitcher.js new file mode 100644 index 00000000..5a33444e --- /dev/null +++ b/src/content/dependencies/generateInterpageDotSwitcher.js @@ -0,0 +1,31 @@ +export default { + contentDependencies: ['generateDotSwitcherTemplate'], + extraDependencies: ['html', 'language'], + + relations: (relation) => ({ + template: + relation('generateDotSwitcherTemplate'), + }), + + slots: { + attributes: { + type: 'attributes', + mutable: false, + }, + + links: { + validate: v => v.strictArrayOf(v.isHTML), + }, + }, + + generate: (relations, slots) => + relations.template.slots({ + attributes: [ + {class: 'interpage'}, + slots.attributes, + ], + + // TODO: Do something to set a class on a link to the current page?? + options: slots.links, + }), +}; -- cgit 1.3.0-6-gf8a5