@eventcatalog/core 2.2.6 → 2.2.7

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/.prettierrc CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
- "semi": true,
3
- "singleQuote": true,
4
- "printWidth": 130,
5
- "tabWidth": 2,
6
- "useTabs": false,
7
- "trailingComma": "es5",
8
- "bracketSpacing": true
9
- }
10
-
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "printWidth": 130,
5
+ "tabWidth": 2,
6
+ "useTabs": false,
7
+ "trailingComma": "es5",
8
+ "bracketSpacing": true,
9
+ "plugins": ["prettier-plugin-astro"],
10
+ "overrides": [
11
+ {
12
+ "files": "*.astro",
13
+ "options": {
14
+ "parser": "astro"
15
+ }
16
+ }
17
+ ]
18
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - d7148fa: chore(core): fixed long labels on the documentation sidebar
8
+
3
9
  ## 2.2.6
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.2.6",
4
+ "version": "2.2.7",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -25,8 +25,8 @@
25
25
  "changeset": "changeset",
26
26
  "generate": "node scripts/generate.js",
27
27
  "release": "changeset publish",
28
- "format": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx,json}\"",
29
- "format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,json}\""
28
+ "format": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx,json,astro}\"",
29
+ "format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,json,astro}\""
30
30
  },
31
31
  "dependencies": {
32
32
  "@astrojs/check": "^0.7.0",
@@ -70,7 +70,8 @@
70
70
  "concurrently": "^8.2.2",
71
71
  "cross-env": "^7.0.3",
72
72
  "jest": "^29.7.0",
73
- "prettier": "^3.3.2",
73
+ "prettier": "^3.3.3",
74
+ "prettier-plugin-astro": "^0.14.1",
74
75
  "rimraf": "^5.0.7",
75
76
  "tsup": "^8.1.0"
76
77
  }
@@ -21,13 +21,20 @@ const messages = [...events, ...commands];
21
21
  const allData = [...domains, ...services, ...messages, ...teams, ...users];
22
22
 
23
23
  const eventCatalogConfig = config as CatalogConfig;
24
- const { services: servicesConfig, domains: domainsConfig, messages: messagesConfig, teams: teamsConfig, users: usersConfig, showPageHeadings = true } = eventCatalogConfig?.docs?.sidebar || {};
25
-
26
- const getConfigValue = (obj: any, key:string, defaultValue: any) => {
24
+ const {
25
+ services: servicesConfig,
26
+ domains: domainsConfig,
27
+ messages: messagesConfig,
28
+ teams: teamsConfig,
29
+ users: usersConfig,
30
+ showPageHeadings = true,
31
+ } = eventCatalogConfig?.docs?.sidebar || {};
32
+
33
+ const getConfigValue = (obj: any, key: string, defaultValue: any) => {
27
34
  return obj?.[key] ?? defaultValue;
28
- }
35
+ };
29
36
 
30
- const visibleCollections: {[key:string]: boolean} = {
37
+ const visibleCollections: { [key: string]: boolean } = {
31
38
  events: getConfigValue(messagesConfig, 'visible', true),
32
39
  commands: getConfigValue(messagesConfig, 'visible', true),
33
40
  domains: getConfigValue(domainsConfig, 'visible', true),
@@ -38,20 +45,17 @@ const visibleCollections: {[key:string]: boolean} = {
38
45
 
39
46
  const fetchHeadings = allData.map(async (item) => {
40
47
  const renderHeadings = showPageHeadings;
41
- const headings = renderHeadings ? await item.render() : { headings: []};
48
+ const headings = renderHeadings ? await item.render() : { headings: [] };
42
49
  return {
43
50
  ...item,
44
51
  headings: headings.headings,
45
52
  };
46
53
  });
47
54
 
48
-
49
-
50
- const withHeadings = await Promise.all(fetchHeadings);
55
+ const withHeadings = await Promise.all(fetchHeadings);
51
56
 
52
57
  const sideNav = withHeadings.reduce((acc, item) => {
53
-
54
- const title = (item.collection === 'events' || item.collection === 'commands') ? 'Messages' : item.collection;
58
+ const title = item.collection === 'events' || item.collection === 'commands' ? 'Messages' : item.collection;
55
59
 
56
60
  const group = acc[title] || [];
57
61
 
@@ -61,7 +65,10 @@ const sideNav = withHeadings.reduce((acc, item) => {
61
65
  items: item.collection === 'users' ? [] : item.headings,
62
66
  visible: visibleCollections[item.collection],
63
67
  // @ts-ignore
64
- href: item.data.version ? buildUrl(`/docs/${item.collection}/${item.data.id}/${item.data.version}`) : buildUrl(`/docs/${item.collection}/${item.data.id}`),
68
+ href: item.data.version
69
+ ? // @ts-ignore
70
+ buildUrl(`/docs/${item.collection}/${item.data.id}/${item.data.version}`)
71
+ : buildUrl(`/docs/${item.collection}/${item.data.id}`),
65
72
  };
66
73
 
67
74
  group.push(navigationItem);
@@ -73,23 +80,29 @@ const sideNav = withHeadings.reduce((acc, item) => {
73
80
  }, {} as any);
74
81
 
75
82
  const currentPath = Astro.url.pathname;
76
-
77
83
  ---
78
84
 
79
- <div class="font-light w-full xl:pr-10 pb-20 ">
85
+ <div class="font-light w-full xl:pr-10 pb-20">
80
86
  {
81
87
  Object.keys(sideNav).map((key) => {
82
88
  const collection = sideNav[key];
83
- if(collection[0] && collection[0].visible === false) return null;
89
+ if (collection[0] && collection[0].visible === false) return null;
84
90
  return (
85
91
  <ul class=" w-full space-y-2 pb-8">
86
92
  <li class="font-semibold capitalize ">{key}</li>
87
93
  {collection.map((item: any) => {
88
94
  return (
89
- <li class="px-2 w-full text-md xl:text-lg border-l border-gray-200 space-y-2 scroll-m-20" id={item.href} >
90
- <a class={`flex justify-between items-center w-full px-2 rounded-md font-normal ${currentPath.includes(item.href) ? 'bg-purple-200 text-purple-800 ' : 'font-thin'}`} href={`${item.href}`}>
91
- <span class="block">{item.label}</span>
92
- {item.version && <span class="block text-sm bg-purple-100 p-0.5 px-1 text-gray-600 rounded-md font-light">v{item.version}</span>}
95
+ <li class="px-2 w-full text-md xl:text-lg border-l border-gray-200 space-y-2 scroll-m-20" id={item.href}>
96
+ <a
97
+ class={`flex justify-between items-center w-full px-2 rounded-md font-normal ${currentPath.includes(item.href) ? 'bg-purple-200 text-purple-800 ' : 'font-thin'}`}
98
+ href={`${item.href}`}
99
+ >
100
+ <span class="block truncate !whitespace-normal">{item.label}</span>
101
+ {item.version && (
102
+ <span class="block text-sm bg-purple-100 p-0.5 px-1 text-gray-600 rounded-md font-light">
103
+ v{item.version}
104
+ </span>
105
+ )}
93
106
  </a>
94
107
  <ul class="hidden xl:block px-4 text-gray-500 text-md space-y-2 ">
95
108
  {item.items.map((heading: any) => {
@@ -121,10 +134,6 @@ const currentPath = Astro.url.pathname;
121
134
  block: 'start',
122
135
  inline: 'start',
123
136
  });
124
-
125
- // currentElement.scrollIntoView({
126
- // behavior: 'auto'
127
- // });
128
137
  }
129
138
  });
130
- </script>
139
+ </script>
@@ -17,16 +17,16 @@ const navItems = [
17
17
  {
18
18
  label: 'Discover',
19
19
  href: buildUrl('/discover/events'),
20
- }
20
+ },
21
21
  ];
22
22
 
23
23
  const logo = {
24
24
  src: ('/' + (catalog?.logo?.src || 'logo.png')).replace(/^\/+/, '/'), // replace the leading slashes with a single one
25
25
  alt: catalog?.logo?.alt || 'Event Catalog',
26
- text: catalog?.logo?.text || "EventCatalog"
27
- }
28
-
26
+ text: catalog?.logo?.text || 'EventCatalog',
27
+ };
29
28
  ---
29
+
30
30
  <nav class="md:fixed top-0 w-full z-20 bg-white border-b border-gray-200 py-4 font-bold text-xl max-w-[70em]">
31
31
  <div class="flex justify-between items-center">
32
32
  <div class="w-1/3 flex space-x-2 items-center">
@@ -57,14 +57,17 @@ const logo = {
57
57
  </div> -->
58
58
  <div class="w-1/3 justify-end text-md">
59
59
  <ul class="text-right flex justify-end space-x-8">
60
- {navItems.map((item) => {
61
- const isActive = currentPath.includes(item.href) ;
62
- return <li class={`font-light ${isActive ? 'border-b-2 border-purple-500': ''}`}>
63
- <a href={item.href}>{item.label}</a>
64
- </li>
65
- })}
60
+ {
61
+ navItems.map((item) => {
62
+ const isActive = currentPath.includes(item.href);
63
+ return (
64
+ <li class={`font-light ${isActive ? 'border-b-2 border-purple-500' : ''}`}>
65
+ <a href={item.href}>{item.label}</a>
66
+ </li>
67
+ );
68
+ })
69
+ }
66
70
  </ul>
67
71
  </div>
68
72
  </div>
69
73
  </nav>
70
-
@@ -4,34 +4,46 @@ import { buildUrl } from '@utils/url-builder';
4
4
  import type { CollectionEntry } from 'astro:content';
5
5
 
6
6
  interface Props {
7
- versions: string[]
8
- collectionItem: CollectionEntry<CollectionTypes>
7
+ versions: string[];
8
+ collectionItem: CollectionEntry<CollectionTypes>;
9
9
  }
10
10
 
11
11
  const { versions, collectionItem } = Astro.props;
12
12
  const currentPath = Astro.url.pathname;
13
-
14
13
  ---
15
14
 
16
15
  <div class="space-y-2 my-2 mb-8">
17
- <span class="font-light text-black group-data-[hover]:text-black/80 capitalize">Versions ({collectionItem.data.versions?.length})</span>
18
- <select id="version" class="block bg-gray-50 rounded-md border border-gray-200 px-1 py-0.5 text-xs">
19
- {versions.map((version) => {
20
- const isCurrent = currentPath.includes(version);
21
- return <option selected={isCurrent} value={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${version}`)} class={`inline-flex items-center rounded-md px-2 py-1 text-xs text-indigo-700 ring-1 ring-inset ring-indigo-700/10 hover:bg-purple-100 hover:underline ${isCurrent ? 'bg-purple-100 text-purple-500 underline ' : 'bg-white'}`}>
22
- <span>
23
- v{version}
24
- {version === collectionItem.data.latestVersion && <span>(latest)</span>}
25
- </span>
26
- </option>
27
- })}
16
+ <span class="font-light text-black group-data-[hover]:text-black/80 capitalize"
17
+ >Versions ({collectionItem.data.versions?.length})</span
18
+ >
19
+ <select id="version" class="block bg-gray-50 rounded-md border border-gray-200 px-1 py-0.5 text-xs">
20
+ {
21
+ versions.map((version) => {
22
+ const isCurrent = currentPath.includes(version);
23
+ return (
24
+ <option
25
+ selected={isCurrent}
26
+ value={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${version}`)}
27
+ class={`inline-flex items-center rounded-md px-2 py-1 text-xs text-indigo-700 ring-1 ring-inset ring-indigo-700/10 hover:bg-purple-100 hover:underline ${isCurrent ? 'bg-purple-100 text-purple-500 underline ' : 'bg-white'}`}
28
+ >
29
+ <span>
30
+ v{version}
31
+ {version === collectionItem.data.latestVersion && <span>(latest)</span>}
32
+ </span>
33
+ </option>
34
+ );
35
+ })
36
+ }
28
37
  </select>
29
- <a href={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${collectionItem.data.latestVersion}/changelog`)} class="text-[10px] text-gray-500">View changelogs</a>
38
+ <a
39
+ href={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${collectionItem.data.latestVersion}/changelog`)}
40
+ class="text-[10px] text-gray-500">View changelogs</a
41
+ >
30
42
  </div>
31
43
 
32
44
  <script>
33
45
  document.getElementById('version')?.addEventListener('change', (e: any) => {
34
- if (!e.target) return
46
+ if (!e.target) return;
35
47
  window.location.href = e.target.value;
36
- })
48
+ });
37
49
  </script>
@@ -1,9 +1,8 @@
1
1
  ---
2
- import AccordionClient from './Accordion'
3
- const {...props } = Astro.props;
2
+ import AccordionClient from './Accordion';
3
+ const { ...props } = Astro.props;
4
4
  ---
5
5
 
6
- <AccordionClient {...props} client:load>
7
- <slot />
8
- </AccordionClient>
9
-
6
+ <AccordionClient {...props} client:load>
7
+ <slot />
8
+ </AccordionClient>
@@ -1,4 +1,5 @@
1
1
  ---
2
+
2
3
  ---
3
4
 
4
5
  <div class="accordian-group border border-gray-200 rounded-md shadow-sm accordion my-2">
@@ -5,7 +5,6 @@ import { getNodesAndEdges as getNodesAndEdgesForEvent } from '@utils/events/node
5
5
  import { getNodesAndEdges as getNodesAndEdgesForCommand } from '@utils/commands/node-graph';
6
6
  import { getNodesAndEdges as getNodesAndEdgesForDomain } from '@utils/domains/node-graph';
7
7
 
8
-
9
8
  interface Props {
10
9
  id: string;
11
10
  collection: string;
@@ -19,7 +18,7 @@ interface Props {
19
18
  };
20
19
  }
21
20
 
22
- const { id, collection, title, mode = 'simple', linkTo='docs', version, href } = Astro.props;
21
+ const { id, collection, title, mode = 'simple', linkTo = 'docs', version, href } = Astro.props;
23
22
  let nodes = [],
24
23
  edges = [];
25
24
 
@@ -56,7 +55,7 @@ if (collection === 'commands') {
56
55
  edges = eventEdges;
57
56
  }
58
57
 
59
- if(collection === 'domains'){
58
+ if (collection === 'domains') {
60
59
  const { nodes: eventNodes, edges: eventEdges } = await getNodesAndEdgesForDomain({
61
60
  id: id,
62
61
  version,
@@ -66,17 +65,23 @@ if(collection === 'domains'){
66
65
  nodes = eventNodes;
67
66
  edges = eventEdges;
68
67
  }
69
-
70
-
71
-
72
68
  ---
73
69
 
74
70
  <div>
75
- <NodeGraphNew id={id} nodes={nodes} edges={edges} title={title} hrefLabel={href.label} href={href.url} linkTo={linkTo} client:load />
71
+ <NodeGraphNew
72
+ id={id}
73
+ nodes={nodes}
74
+ edges={edges}
75
+ title={title}
76
+ hrefLabel={href.label}
77
+ href={href.url}
78
+ linkTo={linkTo}
79
+ client:load
80
+ />
76
81
  </div>
77
82
 
78
83
  <style is:global>
79
84
  .react-flow__attribution {
80
85
  display: none;
81
86
  }
82
- </style>
87
+ </style>
@@ -3,19 +3,19 @@ const { catalog, id } = Astro.props;
3
3
  import fs from 'node:fs/promises';
4
4
  import { existsSync } from 'fs';
5
5
  import path from 'path';
6
- import SchemaViewerClient from './SchemaViewer'
6
+ import SchemaViewerClient from './SchemaViewer';
7
7
  import Admonition from '../Admonition';
8
8
  let schemas = [];
9
9
 
10
10
  function findSchemaViewers(document: string) {
11
11
  // Define regex pattern to match <SchemaViewer ... />
12
12
  const pattern = /<SchemaViewer\s+([^>]*)\/>/g;
13
-
13
+
14
14
  // Find all matches of the pattern
15
15
  const matches = [...document.matchAll(pattern)];
16
-
16
+
17
17
  // Extract the properties of each SchemaViewer
18
- const schemaViewers = matches.map(match => {
18
+ const schemaViewers = matches.map((match) => {
19
19
  const propsString = match[1];
20
20
  const props = {};
21
21
 
@@ -36,59 +36,54 @@ function findSchemaViewers(document: string) {
36
36
  }
37
37
 
38
38
  try {
39
- const file = await fs.readFile(catalog.absoluteFilePath, 'utf-8');
40
- const schemaViewers = findSchemaViewers(file);
41
-
42
- // Loop around all the possible SchemaViewers in the file.
43
- const getAllComponents = schemaViewers.map(async (schemaViewerProps: any) => {
39
+ const file = await fs.readFile(catalog.absoluteFilePath, 'utf-8');
40
+ const schemaViewers = findSchemaViewers(file);
44
41
 
45
- const schemaPath = path.join(catalog.filePath, schemaViewerProps.file)
46
- const exists = existsSync(schemaPath);
47
- let schema;
42
+ // Loop around all the possible SchemaViewers in the file.
43
+ const getAllComponents = schemaViewers.map(async (schemaViewerProps: any) => {
44
+ const schemaPath = path.join(catalog.filePath, schemaViewerProps.file);
45
+ const exists = existsSync(schemaPath);
46
+ let schema;
48
47
 
49
- if(exists) {
50
- // Load the schema for the component
51
- schema = await fs.readFile(schemaPath, 'utf-8');
52
- schema = JSON.parse(schema);
53
- }
48
+ if (exists) {
49
+ // Load the schema for the component
50
+ schema = await fs.readFile(schemaPath, 'utf-8');
51
+ schema = JSON.parse(schema);
52
+ }
54
53
 
55
- return {
56
- id: schemaViewerProps.id || id,
57
- exists,
58
- schema,
59
- schemaPath,
60
- ...schemaViewerProps
61
- }
62
- });
63
-
64
- schemas = await Promise.all(getAllComponents);
54
+ return {
55
+ id: schemaViewerProps.id || id,
56
+ exists,
57
+ schema,
58
+ schemaPath,
59
+ ...schemaViewerProps,
60
+ };
61
+ });
65
62
 
63
+ schemas = await Promise.all(getAllComponents);
66
64
  } catch (error) {
67
- console.log('Failed to process schemas')
68
- console.log(error);
65
+ console.log('Failed to process schemas');
66
+ console.log(error);
69
67
  }
70
-
71
68
  ---
72
- <section class="space-y-4">
73
- {schemas.length > 0 &&
74
- schemas.map((schema) => (
75
- <div>
76
-
77
- {schema.exists &&
78
- <SchemaViewerClient {...schema} client:load />
79
- }
80
69
 
81
- {/* User has tried to load the schema, but it was not found on file system */}
82
- {!schema.exists && (
83
- <Admonition type="warning">
84
- <>
85
- <span class="block font-bold">{`<SchemaViewer/>`} failed to load</span>
86
- <span class="block">Tried to load schema from {schema.schemaPath}, but no schema can be found</span>
87
- </>
88
- </Admonition>
89
- )}
70
+ <section class="space-y-4">
71
+ {
72
+ schemas.length > 0 &&
73
+ schemas.map((schema) => (
74
+ <div>
75
+ {schema.exists && <SchemaViewerClient {...schema} client:load />}
90
76
 
91
- </div>
92
- ))
93
- }
77
+ {/* User has tried to load the schema, but it was not found on file system */}
78
+ {!schema.exists && (
79
+ <Admonition type="warning">
80
+ <>
81
+ <span class="block font-bold">{`<SchemaViewer/>`} failed to load</span>
82
+ <span class="block">Tried to load schema from {schema.schemaPath}, but no schema can be found</span>
83
+ </>
84
+ </Admonition>
85
+ )}
86
+ </div>
87
+ ))
88
+ }
94
89
  </section>
@@ -21,10 +21,21 @@ import PageFindSearch from 'astro-pagefind/components/Search';
21
21
  <div id="search-dialog" class="hidden relative z-10" role="dialog" aria-modal="true">
22
22
  <div class="fixed inset-0 bg-gray-500 bg-opacity-25 transition-opacity search-background backdrop-blur-sm bg-black/10"></div>
23
23
  <div id="search-background" class="fixed inset-0 z-10 w-screen overflow-y-auto p-4 sm:p-6 md:p-20">
24
- <div id="command-pal" class="mx-auto max-w-xl divide-y divide-gray-100 overflow-hidden rounded-xl bg-white shadow-2xl ring-1 ring-black ring-opacity-5 transition-all">
24
+ <div
25
+ id="command-pal"
26
+ class="mx-auto max-w-xl divide-y divide-gray-100 overflow-hidden rounded-xl bg-white shadow-2xl ring-1 ring-black ring-opacity-5 transition-all"
27
+ >
25
28
  <div class="relative">
26
- <svg class="pointer-events-none absolute left-4 top-3.5 h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
27
- <path fill-rule="evenodd" d="M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z" clip-rule="evenodd"></path>
29
+ <svg
30
+ class="pointer-events-none absolute left-4 top-3.5 h-5 w-5 text-gray-400"
31
+ viewBox="0 0 20 20"
32
+ fill="currentColor"
33
+ aria-hidden="true"
34
+ >
35
+ <path
36
+ fill-rule="evenodd"
37
+ d="M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z"
38
+ clip-rule="evenodd"></path>
28
39
  </svg>
29
40
  <PageFindSearch id="search" className="pagefind-ui" uiOptions={{ showImages: false }} />
30
41
  </div>
@@ -42,8 +53,8 @@ import PageFindSearch from 'astro-pagefind/components/Search';
42
53
  event.preventDefault();
43
54
  dummyInput?.click();
44
55
  }
45
- if(event.key === 'Escape') {
46
- if(dialog){
56
+ if (event.key === 'Escape') {
57
+ if (dialog) {
47
58
  dialog.style.display = 'none';
48
59
  }
49
60
  }
@@ -4,12 +4,7 @@ import config from '@config';
4
4
  import defaultImageFile from '../../public/opengraph.png';
5
5
  import { buildUrl } from '@utils/url-builder';
6
6
 
7
- const {
8
- title = config.title,
9
- description = config.tagline,
10
- ogTitle = title,
11
- ogType = 'website',
12
- } = Astro.props;
7
+ const { title = config.title, description = config.tagline, ogTitle = title, ogType = 'website' } = Astro.props;
13
8
 
14
9
  const siteBaseURL = new URL(Astro.url);
15
10
  const defaultImage = new URL(defaultImageFile.src, siteBaseURL);
@@ -19,13 +14,12 @@ _image = _image || defaultImage;
19
14
 
20
15
  let image = null;
21
16
  if (typeof _image === 'string') {
22
- image = new URL(_image, siteBaseURL);
17
+ image = new URL(_image, siteBaseURL);
23
18
  } else if (_image && typeof _image['href'] !== 'undefined') {
24
- image = new URL(_image['href'], siteBaseURL);
19
+ image = new URL(_image['href'], siteBaseURL);
25
20
  } else {
26
- image = defaultImage;
21
+ image = defaultImage;
27
22
  }
28
-
29
23
  ---
30
24
 
31
25
  <meta charset="UTF-8" />
@@ -34,47 +28,47 @@ if (typeof _image === 'string') {
34
28
  <link rel="icon" type="image/svg+xml" href={buildUrl('/favicon.ico', true)} />
35
29
 
36
30
  <SEO
37
- title={title}
38
- description={description}
39
- openGraph={{
40
- basic: {
41
- url: config.homepageLink,
42
- title: ogTitle,
43
- type: ogType,
44
- image: _image?.src ? _image.src : defaultImage.toString(),
45
- },
46
- image: {
47
- url: image.toString(),
48
- secureUrl: image.toString(),
49
- alt: ogTitle,
50
- height: _image?.height,
51
- width: _image?.width,
52
- type: _image?.format && `image/${_image.format}`,
53
- },
54
- }}
55
- twitter={{
56
- creator: '@liran_tal',
57
- image: image ? image.toString() : undefined,
58
- imageAlt: ogTitle,
59
- title: ogTitle,
60
- site: '@liran_tal',
61
- description: description,
62
- card: image ? 'summary_large_image' : 'summary',
63
- }}
64
- extend={{
65
- meta: [
66
- {
67
- name: 'og:locale',
68
- content: 'en_US',
69
- },
70
- {
71
- name: 'og:description',
72
- content: description,
73
- },
74
- {
75
- name: 'og:site_name',
76
- content: config.homepageLink,
77
- }
78
- ]
79
- }}
80
- />
31
+ title={title}
32
+ description={description}
33
+ openGraph={{
34
+ basic: {
35
+ url: config.homepageLink,
36
+ title: ogTitle,
37
+ type: ogType,
38
+ image: _image?.src ? _image.src : defaultImage.toString(),
39
+ },
40
+ image: {
41
+ url: image.toString(),
42
+ secureUrl: image.toString(),
43
+ alt: ogTitle,
44
+ height: _image?.height,
45
+ width: _image?.width,
46
+ type: _image?.format && `image/${_image.format}`,
47
+ },
48
+ }}
49
+ twitter={{
50
+ creator: '@liran_tal',
51
+ image: image ? image.toString() : undefined,
52
+ imageAlt: ogTitle,
53
+ title: ogTitle,
54
+ site: '@liran_tal',
55
+ description: description,
56
+ card: image ? 'summary_large_image' : 'summary',
57
+ }}
58
+ extend={{
59
+ meta: [
60
+ {
61
+ name: 'og:locale',
62
+ content: 'en_US',
63
+ },
64
+ {
65
+ name: 'og:description',
66
+ content: description,
67
+ },
68
+ {
69
+ name: 'og:site_name',
70
+ content: config.homepageLink,
71
+ },
72
+ ],
73
+ }}
74
+ />