« get me outta code hell

generateExternalPlatform.js « dependencies « content « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateExternalPlatform.js
blob: c4f63ecf97088d04c91902236372977d5aea985b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import {isExternalLinkContext} from '#external-links';

export default {
  extraDependencies: ['html', 'language'],

  data: (url) => ({url}),

  slots: {
    context: {
      validate: () => isExternalLinkContext,
      default: 'generic',
    },
  },

  generate: (data, slots, {language}) =>
    language.formatExternalLink(data.url, {
      style: 'platform',
      context: slots.context,
    }),
};