-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathindex.js
More file actions
160 lines (149 loc) · 4.8 KB
/
Copy pathindex.js
File metadata and controls
160 lines (149 loc) · 4.8 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/**
* Add your config changes here.
* @module config
* @example
* export default function applyConfig(config) {
* config.settings = {
* ...config.settings,
* port: 4300,
* listBlockTypes: {
* ...config.settings.listBlockTypes,
* 'my-list-item',
* }
* }
*/
import {
config as faConfig,
dom as faDom,
library,
} from '@fortawesome/fontawesome-svg-core';
import MembershipControlPanel from '../components/Controlpanels/MembershipControlPanel';
import * as Icons from '@fortawesome/free-solid-svg-icons';
import * as IconsRegular from '@fortawesome/free-regular-svg-icons';
import { CustomCSS } from '@package/components';
import { SiteBlocks } from '@package/config/Blocks';
import { SiteWidgets } from '@package/config/Widgets';
import { SiteViews } from '@package/config/Views';
import applyRichTextConfig from '@package/config/RichTextEditor/config';
import applyAccordionConfig from '@package/config/Accordion/config';
import groupSVG from '@plone/volto/icons/group.svg';
import '@plone/volto/config';
faConfig.autoAddCss = false;
const iconList = Object.keys(Icons.fas).map((icon) => Icons[icon]);
const iconListRegular = Object.keys(IconsRegular.far).map(
(icon) => IconsRegular[icon],
);
library.add(...iconList, ...iconListRegular);
const additionalExpressMiddlewareServerConfig =
typeof __SERVER__ !== 'undefined' && __SERVER__
? require('../express-middleware').default
: false;
export default function applyConfig(config) {
config = applyRichTextConfig(config);
config = applyAccordionConfig(config);
config.addonRoutes = [
...(config.addonRoutes || []),
{
path: '/controlpanel/membership',
component: MembershipControlPanel,
},
];
config.settings = {
...config.settings,
isMultilingual: false,
supportedLanguages: ['en'],
defaultLanguage: 'en',
showTags: false,
matomoSiteId: '9',
matomoUrlBase: 'https://stats.plone.org/',
controlpanels: [
...config.settings.controlpanels,
{
'@id': '/membership',
group: 'Plone Foundation',
title: 'Membership',
},
],
controlPanelsIcons: {
...config.settings.controlPanelsIcons,
membership: groupSVG,
},
nonContentRoutes: [
...config.settings.nonContentRoutes,
'/controlpanel/membership',
],
appExtras: [
...config.settings.appExtras,
{
match: '',
component: () => <style type="text/css">{faDom.css()}</style>, //load fontawesom dom css
},
{ match: '', component: CustomCSS },
],
serverConfig: {
...config.settings.serverConfig,
extractScripts: {
...config.settings.serverConfig.extractScripts,
errorPages: true,
},
},
};
if (additionalExpressMiddlewareServerConfig) {
config.settings.expressMiddleware = [
...config.settings.expressMiddleware,
...additionalExpressMiddlewareServerConfig,
];
}
config.blocks.blocksConfig.__grid = {
...config.blocks.blocksConfig.__grid,
gridAllowedBlocks: ['teaser', 'image', 'slate', 'html', 'listing'],
};
config.settings['volto-gdpr-privacy'].defaultPanelConfig = {
...config.settings['volto-gdpr-privacy'].defaultPanelConfig,
last_updated: '2022-12-10T00:07:00+00:00',
text: {
en: {
title: 'This site uses cookies',
description:
'For this website we use cookies for anonymous analytics gathering and show external content. You can also enable third parties independently.',
},
},
technical: {
text: {
en: {
title: 'Required cookies',
description:
'This website uses cookies for visitor analytics and login functionality. No personal identifiable information is collected or exchanged with third parties.',
},
},
choices: [
{
config_key: 'MATOMO',
text: {
en: {
title: 'Anonymous analytics with Matomo',
description:
'We host and use our own instance of Matomo, an open source application for anonymous visitor analytics.',
},
},
},
],
},
profiling: {
text: {
en: {
title: 'Third party integrations',
description:
'To show rich content from other websites we use integrations from third parties. These might set cookies and collect personal data that can be used for profiling purposes across websites. You can disable individual services below.',
},
},
choices:
config.settings['volto-gdpr-privacy'].defaultPanelConfig.profiling
.choices,
},
};
SiteBlocks(config); //blocks configuration for Plone.org
SiteWidgets(config); //widgets configuration for Plone.org
SiteViews(config); //views configuration for Plone.org
return config;
}