-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
36 lines (34 loc) · 924 Bytes
/
index.js
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
const fs = require('fs');
const path = require('path');
module.exports = {
options: {
alias: 'seo',
i18n: {
ns: 'aposSeo',
browser: true
}
},
bundle: {
directory: 'modules',
modules: getBundleModuleNames()
},
init(self) {
self.apos.template.prepend('body', '@apostrophecms/seo:tagManagerBody');
self.apos.template.append('head', '@apostrophecms/seo:tagManagerHead');
self.apos.template.prepend('head', '@apostrophecms/seo:metaHead');
},
components(self) {
return {
async metaHead(req, data) {},
async tagManagerBody(req, data) {},
async tagManagerHead(req, data) {}
};
}
};
function getBundleModuleNames() {
const source = path.join(__dirname, './modules/@apostrophecms');
return fs
.readdirSync(source, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => `@apostrophecms/${dirent.name}`);
}