« get me outta code hell

generateSearchSidebarBox.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/generateSearchSidebarBox.js
blob: d4d6b4e0395cd839e114d0cc7f4373640b25ecf8 (plain)
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
export default {
  contentDependencies: ['generatePageSidebarBox'],
  extraDependencies: ['html', 'language'],

  relations: (relation) => ({
    sidebarBox:
      relation('generatePageSidebarBox'),
  }),

  generate: (relations, {html, language}) =>
    relations.sidebarBox.slots({
      attributes: {class: 'wiki-search-sidebar-box'},
      collapsible: false,

      content: [
        html.tag('input', {class: 'wiki-search-input'},
          {
            placeholder:
              language.$('misc.search.placeholder').toString(),
          },
          {type: 'search'}),

        html.tag('template', {class: 'wiki-search-no-results-string'},
          language.$('misc.search.noResults')),
      ],
    }),
};