-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
70 lines (69 loc) · 1.7 KB
/
index.ts
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import path from 'path'
import Options from './Options'
import { ITEM_TYPE_ALL } from './ItemType'
export default function (this: any, moduleOptions: Options) {
const defaultOptions: Options = {
showImage: false,
mustHaveImage: false,
showIntro: true,
showBody: true,
articleShowImage: false,
articleShowIntro: true,
articleShowBody: true,
articleShowFiles: true,
itemType: ITEM_TYPE_ALL,
startDate: undefined,
endDate: undefined,
useCache: true,
cacheMax: 1000,
cacheMaxAge: 60 * 15 * 1000,
basePath: 'news',
itemCount: 50,
itemsPerPage: 0,
language: undefined,
categories: undefined,
keywords: undefined,
markItem: false,
regulatoryText: 'Regulatory',
nonRegulatoryText: 'Non-regulatory',
displayMode: 1,
id: undefined,
}
const options: Options = Object.assign(
{},
defaultOptions,
this.options.cision,
moduleOptions
)
this.extendRoutes((routes: any[], resolve: any) => {
routes.push({
name: 'news',
path: `/${options.basePath}/:id`,
component: resolve(path.resolve(__dirname, 'pages/Article.vue')),
})
})
const templates = [
'pages/Article.vue',
'CisionBlock.js',
'DisplayMode.js',
'Feed.js',
'FeedItem.js',
'ItemType.js',
'Options.js',
'PressFeed.vue',
'PressReleaseCard.vue',
]
for (const template of templates) {
this.addTemplate({
fileName: path.join('cision-block', template),
src: path.resolve(__dirname, template),
})
}
this.addPlugin({
src: path.resolve(__dirname, 'Plugin.js'),
fileName: 'cision-block/Plugin.js',
ssr: true,
options,
})
}
module.exports.meta = require('../package.json')