forked from OpenLineage/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
172 lines (160 loc) · 4.51 KB
/
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
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
161
162
163
164
165
166
167
168
169
170
171
172
const siteMetadata = {
title: `OpenLineage`,
siteUrl: `https://openlineage.io`,
capitalizeTitleOnHome: false,
logo: `/images/ol-logo.svg`,
icon: `/images/icon.svg`,
titleImage: `/images/background.svg`,
ogImage: `/images/galaxy.jpg`,
twoColumnWall: false,
cookiePolicy: false,
introTag: `An open framework for data lineage collection and analysis`,
description: `Data lineage is the foundation for a new generation of powerful, context-aware data tools and best practices. OpenLineage enables consistent collection of lineage metadata, creating a deeper understanding of how data is produced and used.`,
about:
"OpenLineage is an open platform for collection and analysis of data lineage. It tracks metadata about datasets, jobs, and runs, giving users the information required to identify the root cause of complex issues and understand the impact of changes. OpenLineage contains an open standard for lineage data collection, a metadata repository reference implementation (Marquez), libraries for common languages, and integrations with data pipeline tools.",
author: `@openlineage`,
blogItemsPerPage: 10,
integrationItemsPerPage: 10,
darkmode: false,
switchTheme: false,
navLinks: [
{
name: "Home",
url: "/",
},
{
name: "Getting Started",
url: "/getting-started",
},
{
name: "Integrations",
url: "/integration",
},
{
name: "Resources",
url: "/resources",
},
{
name: "Blog",
url: "/blog",
},
],
footerLinks: [
{
name: "Twitter",
url: "https://twitter.com/OpenLineage",
},
{
name: "Slack",
url: "http://bit.ly/OpenLineageSlack",
},
{
name: "GitHub",
url: "https://github.com/OpenLineage/OpenLineage",
},
],
social: [
{
name: "Facebook",
icon: "/images/Facebook.svg",
url: "#",
},
{
name: "Twitter",
icon: "/images/Twitter.svg",
url: "#",
},
{
name: "Instagram",
icon: "/images/Instagram.svg",
url: "#",
},
{
name: "Youtube",
icon: "/images/Youtube.svg",
url: "#",
},
],
contact: {
// leave empty ('') or false to hide form
api_url: "",
description: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet accumsan arcu. Proin ac consequat arcu.`,
mail: "[email protected]",
phone: "000-000-0000",
address: "1234 \nLocation \nLocation",
},
disqus: "",
}
const beforeContactFormSubmit = data => {
// Code 0 - success
// Code 1 - Name
// Code 2 - Email
// Code 3 - Message
// Code 4 - Other
const errors = []
if (data.name.trim().length < 2) {
errors.push({
code: 1,
message: "Enter a name",
})
}
if (!data.email.match(/[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+/)) {
errors.push({
code: 2,
message: "Enter a valid email address",
})
}
if (data.message.trim().length < 15) {
errors.push({
code: 3,
message: "Enter a message with atleast 15 characters",
})
}
if (errors.length > 0)
return {
result: false,
errors: errors,
}
return {
data: {
name: data.name,
email: data.email,
message: data.message,
},
result: true,
}
}
const contactFormSubmit = async (api, data) => {
let res: any = await fetch(api, {
method: "POST",
body: JSON.stringify(data),
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
})
res = await res.json()
if (res.success) {
return {
result: true,
}
}
return {
result: false,
...res,
}
}
const defaults = {
disqus: null,
twoColumnWall: true,
darkmode: false,
switchTheme: true,
capitalizeTitleOnHome: true,
cookiePolicy: false
}
Object.keys(defaults).forEach(item => {
if (siteMetadata[item] === undefined) {
siteMetadata[item] = defaults[item]
}
})
export { siteMetadata, beforeContactFormSubmit, contactFormSubmit }