-
Notifications
You must be signed in to change notification settings - Fork 345
Expand file tree
/
Copy pathrocket.config.mjs
More file actions
62 lines (58 loc) · 1.95 KB
/
rocket.config.mjs
File metadata and controls
62 lines (58 loc) · 1.95 KB
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
import { rocketLaunch } from '@rocket/launch';
import { rocketBlog } from '@rocket/blog';
import { absoluteBaseUrlNetlify } from '@rocket/core/helpers';
import { TitleMetaPlugin } from '@rocket/cli';
import { adjustPluginOptions, addPlugin, removePlugin } from 'plugins-manager';
import matter from 'gray-matter';
import { mdjsSetupCode } from '@mdjs/core';
import { copy } from '@web/rollup-plugin-copy';
/**
* Plugin SocialMediaImagePlugin depends on titleMeta property
* This property is wrapped into Proxy so it cannot be dynamically enhanced inside SocialMediaImagePlugin
* It should really come from another plugin with "dataName" key eq to "titleMeta"
*/
class LionTitleMetaPlugin {
static dataName = 'titleMeta';
async execute(data) {
if (data.titleMeta) {
return data.titleMeta;
}
const grayMatterFile = await matter.read(data.page.inputPath);
if (grayMatterFile.data) {
return grayMatterFile.data;
}
return {};
}
}
export default {
presets: [rocketLaunch(), rocketBlog()],
eleventy(eleventyConfig) {
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.addPassthroughCopy('CNAME');
},
checkLinks: {
ignoreLinkPatterns: ['**/astro'],
},
absoluteBaseUrl: absoluteBaseUrlNetlify('http://localhost:8080'),
setupUnifiedPlugins: [
adjustPluginOptions(mdjsSetupCode, {
simulationSettings: {
simulatorUrl: '/simulator/',
languages: [
{ key: 'de-DE', name: 'German' },
{ key: 'en-GB', name: 'English (United Kingdom)' },
{ key: 'en-US', name: 'English (United States)' },
{ key: 'nl-NL', name: 'Dutch' },
],
},
}),
],
setupBuildPlugins: [
adjustPluginOptions(copy, config => {
// eslint-disable-next-line no-param-reassign
config.patterns = [...config.patterns, 'docs/**/assets/**'];
return config;
}),
],
setupEleventyComputedConfig: [removePlugin(TitleMetaPlugin), addPlugin(LionTitleMetaPlugin)],
};