1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
export default {
relations: (relation, _thing) => ({
contentHeading:
relation('generateContentHeading'),
}),
data: (nameSlot, thing) => ({
nameSlot,
name: thing.name,
nameStyle: thing.nameStyle,
}),
slots: {
attributes: {type: 'attributes', mutable: false},
string: {type: 'string'},
},
generate(data, relations, slots, {html, language}) {
const namePart =
(data.nameStyle === 'utility' ||
data.nameStyle === 'unofficial'
? null
: html.tag('i', data.name));
const title =
(namePart
? language.$(slots.string, {[data.nameSlot]: namePart})
: language.$(slots.string, 'withoutName'));
const stickyTitle =
language.$(slots.string, 'sticky');
return relations.contentHeading.slots({
attributes: slots.attributes,
title,
stickyTitle,
});
},
};
|