forked from scullyio/scully
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscully.sampleBlog.config.ts
102 lines (100 loc) · 2.79 KB
/
scully.sampleBlog.config.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/** load the plugins */
import { ScullyConfig, setPluginConfig } from '@scullyio/scully';
import { getFlashPreventionPlugin } from '@scullyio/scully-plugin-flash-prevention';
import './demos/plugins/errorPlugin';
import './demos/plugins/tocPlugin';
import './demos/plugins/voidPlugin';
import './demos/plugins/extra-plugin.js';
const FlashPrevention = getFlashPreventionPlugin();
setPluginConfig('md', { enableSyntaxHighlighting: true });
export const config: ScullyConfig = {
/** outDir is where the static distribution files end up */
// bareProject:true,
projectName: 'sample-blog',
outDir: './dist/static',
// distFolder: './dist/apps/sample-blog',
// hostName: '0.0.0.0',
// hostUrl: 'http://localHost:5000',
extraRoutes: Promise.resolve(['/exclude/present']),
/** Use only inlined HTML, no data.json will be written/read */
// inlineStateOnly: true,
defaultPostRenderers: ['seoHrefOptimise'],
thumbnails: true,
routes: {
'/demo/:id': {
type: 'extra',
numberOfPages: 5
},
'/home/:topLevel': {
type: 'extra',
data: [
{ title: 'All routes in application', data: 'all' },
{ title: 'Unpublished routes in application', data: 'unpublished' },
{ title: 'Toplevel routes in application', data: '' }
]
},
'/user/:userId': {
// Type is mandatory
type: 'json',
/**
* Every parameter in the route must exist here
*/
userId: {
url: 'http://localhost:8200/users',
resultsHandler: raw => raw.filter(row => row.id < 3),
property: 'id'
}
},
'/user/:userId/post/:postId': {
// Type is mandatory
type: 'json',
/**
* Every parameter in the route must exist here
*/
userId: {
url: 'http://localhost:8200/users',
resultsHandler: raw => raw.filter(row => row.id < 3),
property: 'id'
},
postId: {
url: 'http://localhost:8200/posts?userId=${userId}',
property: 'id'
}
},
'/user/:userId/friend/:friendCode': {
type: 'ignored',
// type:'json',
userId: {
url: 'http://localhost:8200/users',
resultsHandler: raw => raw.filter(row => row.id < 3),
property: 'id'
},
friendCode: {
url: 'http://localhost:8200/users?userId=${userId}',
property: 'id'
}
},
'/blog/:slug': {
type: 'contentFolder',
slug: {
folder: './tests/assets/blog-files'
}
},
'/slow': {
type: FlashPrevention,
postRenderers: [FlashPrevention]
},
'/manualIdle': {
type: 'default',
manualIdleCheck: true
},
'/someRoute': {
type: 'ignored'
}
},
guessParserOptions: {
excludedFiles: [
'apps/sample-blog/src/app/exclude/exclude-routing.module.ts'
]
}
};