-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathconfig.ts
187 lines (175 loc) · 4.87 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
const siteMetadata = {
title: `OSL VVCE`,
siteUrl: `https://osl.netlify.app`,
capitalizeTitleOnHome: true,
logo: `/images/logo.webp`,
icon: `/images/icon.png`,
titleImage: `/images/wall3.jpg`,
ogImage: `/images/wall.png`,
twoColumnWall: false,
introTag: `We do Awesome Things!`,
description: `OSL is a community of passionate college students, who have come together for the cause of promoting and contributing to Free and Open Source.`,
about:
"OSL, a student-run community with over 20+ members from Vidyavardhaka College of Engineering, Mysuru, over the last 2 years, has helped 100+ passionate students to transform into successful & innovative engineers who today work across the world in Fortune 500 Companies loving what they do.",
author: `@osl_vvce`,
blogItemsPerPage: 10,
eventItemsPerPage: 10,
memberItemsPerPage: 20,
portfolioItemsPerPage: 10,
darkmode: true,
switchTheme: true,
navLinks: [
{
name: "HOME",
url: "/",
},
{
name: "ABOUT",
url: "/about",
},
{
name: "BLOG",
url: "/blog",
},
{
name: "EVENTS",
url: "/events",
},
{
name: "MEMBERS",
url: "/members",
},
{
name: "CONTACT",
url: "/contact",
},
],
footerLinks: [
{
name: "PRIVACY POLICY",
url: "/privacy-policy",
},
{
name: "GitHub",
url: "https://github.com/osl-vvce",
},
],
social: [
{
name: "Facebook",
icon: "/images/facebook.svg",
url: "https://www.facebook.com/oslvvce",
},
{
name: "Twitter",
icon: "/images/twitter.svg",
url: "https://twitter.com/osl_vvce",
},
{
name: "Instagram",
icon: "/images/instagram.svg",
url: "https://www.instagram.com/osl.vvce",
},
{
name: "Github",
icon: "/images/github.svg",
url: "https://github.com/osl-vvce",
},
{
name: "LinkedIn",
icon: "/images/linkedin.svg",
url: "https://www.linkedin.com/company/osl-vvce",
},
],
aboutUs: {
main: "/images/about/cloud-computing.png",
about1: "/images/about/team-meeting.svg",
about2: "/images/about/support-team.svg",
about3: "/images/about/office-best-achiever.svg",
member1: "/images/about/madhurish.jpg",
member2: "/images/about/harsha.jpg",
member3: "/images/about/pavan.jpg",
member4: "/images/about/darshan.jpg",
member5: "/images/about/rahul.png",
},
contact: {
api_url: "https://getform.io/f/93b1c53f-0be8-4aa2-ae7c-e16f073c9fc6",
description: `Hey! Looking for a way to get to us? Contact us using any of the links shared below or just drop by at our place!`,
mail: "[email protected]",
phone: "+91 8095699637",
address: "VVCE Mysore- 570002",
},
disqus: "osl-netlify-app",
}
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,
}
Object.keys(defaults).forEach(item => {
if (siteMetadata[item] === undefined) {
siteMetadata[item] = defaults[item]
}
})
export { siteMetadata, beforeContactFormSubmit, contactFormSubmit }