@openeventkit/event-site 2.0.51 → 2.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gatsby-config.js CHANGED
@@ -71,6 +71,14 @@ module.exports = {
71
71
  name: "images"
72
72
  }
73
73
  },
74
+ {
75
+ // Add font assets before markdown or json files
76
+ resolve: "gatsby-source-filesystem",
77
+ options: {
78
+ path: `${__dirname}/static/fonts`,
79
+ name: "fonts"
80
+ }
81
+ },
74
82
  {
75
83
  resolve: "gatsby-source-filesystem",
76
84
  options: {
package/gatsby-node.js CHANGED
@@ -28,8 +28,10 @@ const {
28
28
  VOTEABLE_PRESENTATIONS_FILE_PATH,
29
29
  MARKETING_SETTINGS_FILE_PATH,
30
30
  MAINTENANCE_FILE_PATH,
31
- SPONSORS_FILE_PATH
31
+ SPONSORS_FILE_PATH,
32
+ FONTS_SCSS_FILE_PATH
32
33
  } = require("./src/utils/filePath");
34
+ const { generateFontFile } = require("./src/utils/cssUtils");
33
35
 
34
36
  const fileBuildTimes = [];
35
37
 
@@ -337,6 +339,18 @@ exports.onPreBootstrap = async () => {
337
339
  globalSettings.lastBuild = Date.now();
338
340
 
339
341
  fs.writeFileSync(SITE_SETTINGS_FILE_PATH, JSON.stringify(globalSettings), "utf8");
342
+
343
+ // Read fonts from site settings
344
+ const siteFonts = globalSettings.siteFont;
345
+
346
+ if(siteFonts && Object.keys(siteFonts).length > 0) {
347
+ // Generate the SCSS file
348
+ const scssFontsFile = generateFontFile(siteFonts);
349
+ if(scssFontsFile) {
350
+ fs.writeFileSync(FONTS_SCSS_FILE_PATH, scssFontsFile);
351
+ console.log(`CUSTOM FONT FILE ${FONTS_SCSS_FILE_PATH} generated.`);
352
+ }
353
+ }
340
354
  };
341
355
 
342
356
  exports.createSchemaCustomization = ({ actions }) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openeventkit/event-site",
3
3
  "description": "Event Site",
4
- "version": "2.0.51",
4
+ "version": "2.0.52",
5
5
  "author": "Tipit LLC",
6
6
  "dependencies": {
7
7
  "@mui/base": "^5.0.0-alpha.114",
@@ -5,13 +5,26 @@ import {
5
5
  imageField,
6
6
  selectField,
7
7
  selectOption,
8
- objectField
8
+ objectField,
9
+ fileField
9
10
  } from "../../../fields";
10
11
 
11
12
  import {
12
- SITE_SETTINGS_FILE_PATH
13
+ SITE_SETTINGS_FILE_PATH,
14
+ CMS_FONT_FILE_PATH
13
15
  } from "@utils/filePath";
14
16
 
17
+ const FONT_FORMATS = {
18
+ truetype: "ttf",
19
+ opentype: "otf",
20
+ woff: "woff",
21
+ woff2: "woff2",
22
+ eot: "eot",
23
+ };
24
+
25
+ const getFontFormatOptions = () =>
26
+ Object.entries(FONT_FORMATS).map(([key, value]) => selectOption({ label: value, value: value }));
27
+
15
28
  const siteSettings = {
16
29
  label: "Site Settings",
17
30
  name: "site-settings",
@@ -71,7 +84,7 @@ const siteSettings = {
71
84
  booleanField({
72
85
  label: "Show Help",
73
86
  name: "showHelp",
74
- required: false,
87
+ required: false,
75
88
  default: false
76
89
  }),
77
90
  selectField({
@@ -104,7 +117,57 @@ const siteSettings = {
104
117
  ]
105
118
  }),
106
119
  ]
107
- })
120
+ }),
121
+ objectField({
122
+ label: "Site Font",
123
+ name: "siteFont",
124
+ fields: [
125
+ textField({
126
+ label: "Font Name",
127
+ name: "fontFamily",
128
+ required: true,
129
+ default: "Nunito Sans"
130
+ }),
131
+ objectField({
132
+ label: "Regular Font",
133
+ name: "regularFont",
134
+ fields: [
135
+ fileField({
136
+ label: "Font File",
137
+ name: "fontFile",
138
+ required: false,
139
+ media_folder: CMS_FONT_FILE_PATH,
140
+ }),
141
+ selectField({
142
+ label: "Font Format",
143
+ name: "fontFormat",
144
+ multiple: false,
145
+ required: false,
146
+ options: getFontFormatOptions()
147
+ })
148
+ ],
149
+ }),
150
+ objectField({
151
+ label: "Bold Font",
152
+ name: "boldFont",
153
+ fields: [
154
+ fileField({
155
+ label: "Font File",
156
+ name: "fontFile",
157
+ media_folder: CMS_FONT_FILE_PATH,
158
+ required: false,
159
+ }),
160
+ selectField({
161
+ label: "Font Format",
162
+ name: "fontFormat",
163
+ multiple: false,
164
+ required: false,
165
+ options: getFontFormatOptions()
166
+ })
167
+ ],
168
+ }),
169
+ ]
170
+ }),
108
171
  ]
109
172
  };
110
173
 
@@ -1 +1 @@
1
- {"widgets":{"chat":{"showQA":false,"showHelp":false,"defaultScope":"page"},"schedule":{"allowClick":true}},"favicons":{"favicon180":"/img/favicon.png","favicon32":"/img/favicon.png","favicon16":"/img/favicon.png"},"staticJsonFilesBuildTime":[{"file":"src/data/summit.json","build_time":1692922259099},{"file":"src/data/events.json","build_time":1692922264079},{"file":"src/data/events.idx.json","build_time":1692922264084},{"file":"src/data/speakers.json","build_time":1692922268263},{"file":"src/data/speakers.idx.json","build_time":1692922268264},{"file":"src/content/sponsors.json","build_time":1692922271753},{"file":"src/data/voteable-presentations.json","build_time":1692922272661}],"lastBuild":1692922272663}
1
+ {"widgets":{"chat":{"showQA":false,"showHelp":false,"defaultScope":"page"},"schedule":{"allowClick":true}},"favicons":{"favicon180":"/img/favicon.png","favicon32":"/img/favicon.png","favicon16":"/img/favicon.png"},"staticJsonFilesBuildTime":[{"file":"src/data/summit.json","build_time":1692386447666},{"file":"src/data/events.json","build_time":1692386451064},{"file":"src/data/events.idx.json","build_time":1692386451066},{"file":"src/data/speakers.json","build_time":1692386451884},{"file":"src/data/speakers.idx.json","build_time":1692386451884},{"file":"src/content/sponsors.json","build_time":1692386455106},{"file":"src/data/voteable-presentations.json","build_time":1692386457214}],"lastBuild":1692386457215}
@@ -1 +1 @@
1
- [{"id":229,"created":1692845763,"last_edited":1692845763,"order":8,"summit_id":49,"is_published":true,"side_image":null,"header_image":"https://summit-api-assets.sfo2.digitaloceanspaces.com/summits/49/sponsors/229/RDC23-FNV-Booth-Header-DevRel1.png","header_image_mobile":"https://summit-api-assets.sfo2.digitaloceanspaces.com/summits/49/sponsors/229/RDC23-FNV-Booth-Header-Mobile-DevRel.png","carousel_advertise_image":null,"marquee":"","intro":"","external_link":"","video_link":"","chat_link":"","featured_event_id":0,"header_image_alt_text":"","side_image_alt_text":"","header_image_mobile_alt_text":"","carousel_advertise_image_alt_text":"","show_logo_in_event_page":true,"members":[],"company":{"id":4223,"created":1692845761,"last_edited":1692845761,"name":"Developer Relations","url":"","display_on_site":false,"featured":false,"city":"","state":"","country":"","description":"","industry":"","contributions":"","contact_email":"","member_level":"None","admin_email":"","overview":"","products":"","commitment":"","commitment_author":"","logo":"https://summit-api-assets.sfo2.digitaloceanspaces.com/companies/4223/logos/RDC23-FNV-Booth-Logo-DevRel2.png","big_logo":"https://summit-api-assets.sfo2.digitaloceanspaces.com/companies/4223/logos/RDC23-FNV-Booth-Logo-DevRel3.png","color":"#6347ff","sponsorships":[],"project_sponsorships":[]},"sponsorship":{"id":2049,"widget_title":"","lobby_template":null,"expo_hall_template":"big-images","sponsor_page_template":"big-header","event_page_template":null,"sponsor_page_use_disqus_widget":true,"sponsor_page_use_live_event_widget":true,"sponsor_page_use_schedule_widget":false,"sponsor_page_use_banner_widget":true,"badge_image":null,"badge_image_alt_text":"","summit_id":49,"order":2,"should_display_on_expo_hall_page":true,"should_display_on_lobby_page":false,"type":{"id":25,"created":1692845527,"last_edited":1692845527,"name":"RDC Booth","label":"RDC Booth","order":25,"size":"Medium"}},"ads":[],"materials":[],"social_networks":[]},{"id":230,"created":1692845800,"last_edited":1692845800,"order":10,"summit_id":49,"is_published":true,"side_image":null,"header_image":"https://summit-api-assets.sfo2.digitaloceanspaces.com/summits/49/sponsors/230/RDC23-FNV-Booth-Header-EduPartner2.png","header_image_mobile":"https://summit-api-assets.sfo2.digitaloceanspaces.com/summits/49/sponsors/230/RDC23-FNV-Booth-Header-Mobile-EduPartner.png","carousel_advertise_image":null,"marquee":"Education Partnerships","intro":"<p>Education Partnerships</p>","external_link":"","video_link":"","chat_link":"","featured_event_id":0,"header_image_alt_text":"Education Partnerships","side_image_alt_text":"","header_image_mobile_alt_text":"","carousel_advertise_image_alt_text":"","show_logo_in_event_page":true,"members":[],"company":{"id":4224,"created":1692845794,"last_edited":1692845794,"name":"Education Partnerships","url":"","display_on_site":false,"featured":false,"city":"","state":"","country":"","description":"","industry":"","contributions":"","contact_email":"","member_level":"None","admin_email":"","overview":"","products":"","commitment":"","commitment_author":"","logo":"https://summit-api-assets.sfo2.digitaloceanspaces.com/companies/4224/logos/RDC23-FNV-Booth-Logo-EduPartner2.png","big_logo":"https://summit-api-assets.sfo2.digitaloceanspaces.com/companies/4224/logos/RDC23-FNV-Booth-Logo-EduPartner3.png","color":"#6347ff","sponsorships":[],"project_sponsorships":[]},"sponsorship":{"id":2049,"widget_title":"","lobby_template":null,"expo_hall_template":"big-images","sponsor_page_template":"big-header","event_page_template":null,"sponsor_page_use_disqus_widget":true,"sponsor_page_use_live_event_widget":true,"sponsor_page_use_schedule_widget":false,"sponsor_page_use_banner_widget":true,"badge_image":null,"badge_image_alt_text":"","summit_id":49,"order":2,"should_display_on_expo_hall_page":true,"should_display_on_lobby_page":false,"type":{"id":25,"created":1692845527,"last_edited":1692845527,"name":"RDC Booth","label":"RDC Booth","order":25,"size":"Medium"}},"ads":[],"materials":[],"social_networks":[]},{"id":231,"created":1692845834,"last_edited":1692845834,"order":13,"summit_id":49,"is_published":true,"side_image":null,"header_image":"https://summit-api-assets.sfo2.digitaloceanspaces.com/summits/49/sponsors/231/RDC23-FNV-Booth-Header-ImmersiveAds1.png","header_image_mobile":"https://summit-api-assets.sfo2.digitaloceanspaces.com/summits/49/sponsors/231/RDC23-FNV-Booth-Header-Mobile-ImmersiveAds.png","carousel_advertise_image":null,"marquee":"","intro":"","external_link":"","video_link":"","chat_link":"","featured_event_id":0,"header_image_alt_text":"","side_image_alt_text":"","header_image_mobile_alt_text":"","carousel_advertise_image_alt_text":"","show_logo_in_event_page":true,"members":[],"company":{"id":4225,"created":1692845830,"last_edited":1692845830,"name":"Immersive Ads","url":"","display_on_site":false,"featured":false,"city":"","state":"","country":"","description":"","industry":"","contributions":"","contact_email":"","member_level":"None","admin_email":"","overview":"","products":"","commitment":"","commitment_author":"","logo":"https://summit-api-assets.sfo2.digitaloceanspaces.com/companies/4225/logos/RDC23-FNV-Booth-Logo-ImmersiveAds3.png","big_logo":"https://summit-api-assets.sfo2.digitaloceanspaces.com/companies/4225/logos/RDC23-FNV-Booth-Logo-ImmersiveAds2.png","color":"#6347ff","sponsorships":[],"project_sponsorships":[]},"sponsorship":{"id":2049,"widget_title":"","lobby_template":null,"expo_hall_template":"big-images","sponsor_page_template":"big-header","event_page_template":null,"sponsor_page_use_disqus_widget":true,"sponsor_page_use_live_event_widget":true,"sponsor_page_use_schedule_widget":false,"sponsor_page_use_banner_widget":true,"badge_image":null,"badge_image_alt_text":"","summit_id":49,"order":2,"should_display_on_expo_hall_page":true,"should_display_on_lobby_page":false,"type":{"id":25,"created":1692845527,"last_edited":1692845527,"name":"RDC Booth","label":"RDC Booth","order":25,"size":"Medium"}},"ads":[],"materials":[],"social_networks":[]},{"id":232,"created":1692846137,"last_edited":1692846137,"order":16,"summit_id":49,"is_published":true,"side_image":null,"header_image":"https://summit-api-assets.sfo2.digitaloceanspaces.com/summits/49/sponsors/232/RDC23-FNV-Booth-Header-Studio-AI1.png","header_image_mobile":"https://summit-api-assets.sfo2.digitaloceanspaces.com/summits/49/sponsors/232/RDC23-FNV-Booth-Header-Mobile-Studio-AI.png","carousel_advertise_image":null,"marquee":"","intro":"","external_link":"","video_link":"","chat_link":"","featured_event_id":0,"header_image_alt_text":"","side_image_alt_text":"","header_image_mobile_alt_text":"","carousel_advertise_image_alt_text":"","show_logo_in_event_page":true,"members":[],"company":{"id":4226,"created":1692846131,"last_edited":1692846131,"name":"Studio & AI","url":"","display_on_site":false,"featured":false,"city":"","state":"","country":"","description":"","industry":"RDC 2023 Booths","contributions":"","contact_email":"","member_level":"None","admin_email":"","overview":"","products":"","commitment":"","commitment_author":"","logo":"https://summit-api-assets.sfo2.digitaloceanspaces.com/companies/4226/logos/RDC23-FNV-Booth-Logo-StudioAI2.png","big_logo":"https://summit-api-assets.sfo2.digitaloceanspaces.com/companies/4226/logos/RDC23-FNV-Booth-Logo-StudioAI3.png","color":"#6347ff","sponsorships":[],"project_sponsorships":[]},"sponsorship":{"id":2049,"widget_title":"","lobby_template":null,"expo_hall_template":"big-images","sponsor_page_template":"big-header","event_page_template":null,"sponsor_page_use_disqus_widget":true,"sponsor_page_use_live_event_widget":true,"sponsor_page_use_schedule_widget":false,"sponsor_page_use_banner_widget":true,"badge_image":null,"badge_image_alt_text":"","summit_id":49,"order":2,"should_display_on_expo_hall_page":true,"should_display_on_lobby_page":false,"type":{"id":25,"created":1692845527,"last_edited":1692845527,"name":"RDC Booth","label":"RDC Booth","order":25,"size":"Medium"}},"ads":[],"materials":[],"social_networks":[]}]
1
+ [{"id":228,"created":1691602669,"last_edited":1691602669,"order":1,"summit_id":49,"is_published":false,"side_image":null,"header_image":null,"header_image_mobile":null,"carousel_advertise_image":null,"marquee":"","intro":"","external_link":"","video_link":"","chat_link":"","featured_event_id":0,"header_image_alt_text":"","side_image_alt_text":"","header_image_mobile_alt_text":"","carousel_advertise_image_alt_text":"","show_logo_in_event_page":true,"members":[90654],"company":{"id":3,"created":1580138376,"last_edited":1580138376,"name":"Tipit , LLC","url":null,"display_on_site":false,"featured":false,"city":null,"state":null,"country":null,"description":null,"industry":null,"contributions":null,"contact_email":null,"member_level":"None","admin_email":null,"overview":null,"products":null,"commitment":null,"commitment_author":null,"logo":null,"big_logo":null,"color":"#f0f0ee","sponsorships":[616],"project_sponsorships":[]},"sponsorship":{"id":2048,"widget_title":"","lobby_template":null,"expo_hall_template":null,"sponsor_page_template":null,"event_page_template":null,"sponsor_page_use_disqus_widget":false,"sponsor_page_use_live_event_widget":false,"sponsor_page_use_schedule_widget":false,"sponsor_page_use_banner_widget":false,"badge_image":null,"badge_image_alt_text":"","summit_id":49,"order":1,"should_display_on_expo_hall_page":false,"should_display_on_lobby_page":false,"type":{"id":3,"created":1579890943,"last_edited":1579890943,"name":"Gold","label":"not sure??","order":3,"size":"Medium"}},"ads":[],"materials":[],"social_networks":[]}]
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Warning:
3
+ * Dont edit this file by hand, this file is used as default font implementation for the whole site
4
+ * and it been re generated if font settings are set through CMS on gatsby-node.js line # 346
5
+ **/
6
+
1
7
  $font-family: 'Nunito Sans', sans-serif;
2
8
 
3
9
  :root {
@@ -0,0 +1,85 @@
1
+ const getFontFormat = (format) => {
2
+ let formatString = '';
3
+ switch (format) {
4
+ case 'ttf':
5
+ formatString = "format('truetype')";
6
+ break;
7
+ case 'otf':
8
+ formatString = "format('opentype')";
9
+ break;
10
+ case 'woff':
11
+ formatString = "format('woff')";
12
+ break;
13
+ case 'woff2':
14
+ formatString = "format('woff2')";
15
+ break;
16
+ default:
17
+ formatString = null;
18
+ break;
19
+ }
20
+ return formatString;
21
+ }
22
+
23
+ const getFontSrc = (fontPath) => {
24
+ // get the filename from the file path
25
+ const fileName = fontPath.substring(fontPath.lastIndexOf("/")+1)
26
+ return `/fonts/${fileName}`;
27
+ }
28
+
29
+ const generateFontFile = (fontData) => {
30
+ // check fields
31
+ if(!fontData?.fontFamily) return null;
32
+ if(!fontData?.regularFont?.fontFile) return null;
33
+ if(!fontData?.regularFont?.fontFormat) return null;
34
+ if(!fontData?.boldFont?.fontFile) return null;
35
+ if(!fontData?.boldFont?.fontFormat) return null;
36
+
37
+ const scssFonts = `
38
+ $font-family: "${fontData.fontFamily}";
39
+
40
+ :root {
41
+ --font_family: "${fontData.fontFamily}" !important;
42
+ }
43
+
44
+ // Adding these new fonts for this theme
45
+ ${fontData.regularFont && fontData.regularFont.fontFile ?
46
+ `@font-face {
47
+ font-family: "${fontData.fontFamily}";
48
+ src: url("${getFontSrc(fontData.regularFont?.fontFile)}") ${getFontFormat(fontData.regularFont?.fontFormat)};
49
+ font-weight: normal;
50
+ }`
51
+ :
52
+ ''
53
+ }
54
+
55
+ ${fontData.boldFont && fontData.boldFont.fontFile ?
56
+ `@font-face {
57
+ font-family: "${fontData.fontFamily}";
58
+ src: url("${getFontSrc(fontData.boldFont?.fontFile)}") ${getFontFormat(fontData.boldFont?.fontFormat)};
59
+ font-weight: bold;
60
+ }`
61
+ :
62
+ ''
63
+ }
64
+
65
+ %font-regular {
66
+ font-family: "${fontData.fontFamily}";
67
+ font-weight: 400;
68
+ }
69
+
70
+ %font-semi {
71
+ font-family: "${fontData.fontFamily}";
72
+ font-weight: 600;
73
+ }
74
+
75
+ %font-bold {
76
+ font-family: "${fontData.fontFamily}";
77
+ font-weight: 700;
78
+ }
79
+ `;
80
+ return scssFonts;
81
+ };
82
+
83
+ module.exports = {
84
+ generateFontFile
85
+ }
@@ -6,6 +6,7 @@ const STYLES_DIR_PATH = "src/styles";
6
6
  const DEFAULT_COLORS_FILE_PATH = `${DEFAULTS_DIR_PATH}/colors.json`;
7
7
  const COLORS_FILE_PATH = `${DATA_DIR_PATH}/colors.json`;
8
8
  const COLORS_SASS_FILE_PATH = `${STYLES_DIR_PATH}/colors.scss`
9
+ const FONTS_SCSS_FILE_PATH = `${STYLES_DIR_PATH}/fonts.scss`;
9
10
  const SITE_SETTINGS_DIR_PATH = `${STATIC_CONTENT_DIR_PATH}/site-settings`;
10
11
  const SITE_SETTINGS_FILE_PATH = `${SITE_SETTINGS_DIR_PATH}/index.json`;
11
12
  const MARKETING_PAGE_DIR_PATH = `${STATIC_CONTENT_DIR_PATH}/marketing-page`;
@@ -36,6 +37,7 @@ const MAINTENANCE_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/maintenance.json`;
36
37
  const EXPO_HALL_PAGE_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/expo-hall-page/index.json`;
37
38
  const SPONSORS_FILE_NAME = "sponsors.json";
38
39
  const SPONSORS_FILE_PATH = `${STATIC_CONTENT_DIR_PATH}/${SPONSORS_FILE_NAME}`;
40
+ const CMS_FONT_FILE_PATH = "/static/fonts/"
39
41
 
40
42
  exports.REQUIRED_DIR_PATHS = [
41
43
  DATA_DIR_PATH,
@@ -52,6 +54,7 @@ exports.STATIC_CONTENT_DIR_PATH = STATIC_CONTENT_DIR_PATH;
52
54
  exports.DEFAULT_COLORS_FILE_PATH = DEFAULT_COLORS_FILE_PATH;
53
55
  exports.COLORS_FILE_PATH = COLORS_FILE_PATH;
54
56
  exports.COLORS_SASS_FILE_PATH = COLORS_SASS_FILE_PATH;
57
+ exports.FONTS_SCSS_FILE_PATH = FONTS_SCSS_FILE_PATH;
55
58
  exports.SITE_SETTINGS_DIR_PATH = SITE_SETTINGS_DIR_PATH;
56
59
  exports.SITE_SETTINGS_FILE_PATH = SITE_SETTINGS_FILE_PATH;
57
60
  exports.CONTENT_PAGES_DIR_PATH = CONTENT_PAGES_DIR_PATH;
@@ -77,4 +80,5 @@ exports.POSTERS_PAGES_FILE_PATH = POSTERS_PAGES_FILE_PATH;
77
80
  exports.MARKETING_SETTINGS_FILE_PATH = MARKETING_SETTINGS_FILE_PATH;
78
81
  exports.MAINTENANCE_FILE_PATH = MAINTENANCE_FILE_PATH;
79
82
  exports.EXPO_HALL_PAGE_FILE_PATH = EXPO_HALL_PAGE_FILE_PATH;
80
- exports.SPONSORS_FILE_PATH = SPONSORS_FILE_PATH;
83
+ exports.SPONSORS_FILE_PATH = SPONSORS_FILE_PATH;
84
+ exports.CMS_FONT_FILE_PATH = CMS_FONT_FILE_PATH;