forked from d-koppenhagen/k9n.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scully.d-koppenhagen-website.config.ts
128 lines (121 loc) · 2.89 KB
/
scully.d-koppenhagen-website.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { getSitemapPlugin } from '@gammastream/scully-plugin-sitemap';
import { ScullyConfig, setPluginConfig } from '@scullyio/scully';
import { MinifyHtml } from 'scully-plugin-minify-html';
import '@k9n/scully-plugin-toc';
import { TocConfig, TocPluginName } from '@k9n/scully-plugin-toc';
import '@k9n/scully-plugin-mermaid';
import {
MermaidPluginConfig,
MermaidPluginName,
} from '@k9n/scully-plugin-mermaid';
import {
criticalCSS,
CriticalCSSSettings,
} from '@scullyio/scully-plugin-critical-css';
import '@scullyio/scully-plugin-puppeteer';
/**
* configuration for the markdown plugin
*/
setPluginConfig('md', { enableSyntaxHighlighting: true });
/**
* configuration for the mermaid plugin
* All params as defined here are valid:
* https://mermaid-js.github.io/mermaid/getting-started/Setup.html#mermaidapi-configuration-defaults
*/
const mermaidOptions: MermaidPluginConfig = {
config: { theme: 'dark' },
};
setPluginConfig(MermaidPluginName, mermaidOptions);
/**
* configuration for the sitemap plugin
*/
const sitemapPlugin = getSitemapPlugin();
setPluginConfig(sitemapPlugin, {
urlPrefix: 'https://k9n.dev',
sitemapFilename: 'sitemap.xml',
changeFreq: 'monthly',
priority: [
'1.0',
'0.9',
'0.8',
'0.7',
'0.6',
'0.5',
'0.4',
'0.3',
'0.2',
'0.1',
'0.0',
],
ignoredRoutes: [
/*'/404'*/
],
routes: {
'/': {
changeFreq: 'weekly',
priority: '1.0',
sitemapFilename: 'sitemap.xml',
},
'/blog/:slug': {
changeFreq: 'weekly',
priority: '0.9',
sitemapFilename: 'sitemap-blog.xml',
},
'/projects/:slug': {
changeFreq: 'weekly',
priority: '0.8',
sitemapFilename: 'sitemap-blog.xml',
},
},
});
/**
* configuration for the TOC plugin
*/
const tocOptions: TocConfig = {
blogAreaSelector: '.blog-content',
insertSelector: '#toc',
level: ['h2', 'h3'],
trailingSlash: true,
scrollIntoViewOnClick: true,
};
setPluginConfig(TocPluginName, tocOptions);
/**
* configuration for the critical css plugin
*/
const criticalCssOptions: CriticalCSSSettings = {
inlineImages: true,
};
setPluginConfig(criticalCSS, criticalCssOptions);
/**
* configure default postRenderers
*/
const defaultPostRenderers = ['seoHrefOptimise', criticalCSS, MinifyHtml];
/**
* the actual scully configuration
*/
export const config: ScullyConfig = {
projectRoot: './src/app',
projectName: 'd-koppenhagen-website',
outDir: './dist/static',
defaultPostRenderers: [MinifyHtml],
routes: {
'/projects/:slug': {
type: 'contentFolder',
slug: {
folder: './projects',
},
postRenderers: [MermaidPluginName, ...defaultPostRenderers],
},
'/blog/:slug': {
type: 'contentFolder',
postRenderers: [
TocPluginName,
MermaidPluginName,
...defaultPostRenderers,
],
slug: {
folder: './blog',
},
},
},
};