« get me outta code hell

content: gCTExternalLinkSection: inline linkExternalAsIcon behavior - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkExternalAsIcon.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-18 10:21:42 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:16 -0300
commit1529fe740544231d830e42ab94d3fddac68772ff (patch)
treeefe41de029d7e9b62bf882ebb751f01a8100a822 /src/content/dependencies/linkExternalAsIcon.js
parent7357b251e31f7cb27817ac8e75aeb5643b6defe7 (diff)
content: gCTExternalLinkSection: inline linkExternalAsIcon behavior
Diffstat (limited to 'src/content/dependencies/linkExternalAsIcon.js')
-rw-r--r--src/content/dependencies/linkExternalAsIcon.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/content/dependencies/linkExternalAsIcon.js b/src/content/dependencies/linkExternalAsIcon.js
deleted file mode 100644
index 0217e9d6..00000000
--- a/src/content/dependencies/linkExternalAsIcon.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import {isExternalLinkContext} from '#external-links';
-
-export default {
-  contentDependencies: [
-    'generateExternalHandle',
-    'generateExternalIcon',
-    'generateExternalPlatform',
-  ],
-
-  extraDependencies: ['html'],
-
-  relations: (relation, url) => ({
-    icon:
-      relation('generateExternalIcon', url),
-
-    handle:
-      relation('generateExternalHandle', url),
-
-    platform:
-      relation('generateExternalPlatform', url),
-  }),
-
-  data: (url) => ({url}),
-
-  slots: {
-    context: {
-      validate: () => isExternalLinkContext,
-      default: 'generic',
-    },
-  },
-
-  generate(data, relations, slots, {html}) {
-    for (const template of [
-      relations.icon,
-      relations.handle,
-      relations.platform,
-    ]) {
-      template.setSlot('context', slots.context);
-    }
-
-    return (
-      html.tag('a', {class: 'icon'},
-        {href: data.url},
-        {class: 'has-text'},
-
-        [
-          relations.icon,
-
-          html.tag('span', {class: 'icon-text'},
-            (html.isBlank(relations.handle)
-              ? relations.platform
-              : relations.handle)),
-        ]));
-  },
-};