Skip to content

Commit 75b3917

Browse files
committed
Fetch details from forms
1 parent 8f8f13f commit 75b3917

File tree

4 files changed

+60
-76
lines changed

4 files changed

+60
-76
lines changed

src/_data/jobData.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
async function fetchJobData() {
2+
const SPREADSHEET_ID = "1oyMFGGKmR6u5JVpd691iYD_6TuDi3pbvyaajAZfGkGw";
3+
const URL = `https://docs.google.com/spreadsheets/d/${SPREADSHEET_ID}/gviz/tq?tqx=out:json`;
4+
5+
try {
6+
const response = await fetch(URL);
7+
const text = await response.text();
8+
9+
const json = JSON.parse(text.substring(47).slice(0, -2));
10+
11+
const rows = json.table.rows;
12+
13+
const jobPostings = rows.map((row) => ({
14+
title: row.c[1]?.v || "No title",
15+
company: row.c[2]?.v || "Unknown",
16+
company_website: row.c[3]?.v || "#",
17+
job_type: row.c[4]?.v || "N/A",
18+
location: row.c[5]?.v || "Unknown",
19+
description: row.c[6]?.v || "No description available",
20+
link_to_apply: row.c[7]?.v || "#",
21+
}));
22+
23+
return jobPostings;
24+
} catch (error) {
25+
console.error("Error fetching job data:", error);
26+
return [];
27+
}
28+
}
29+
30+
module.exports = async () => {
31+
return await fetchJobData();
32+
};

src/_includes/navbar.njk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"name": "About",
1212
"hasSubmenu": true,
1313
"submenu": [
14-
{"name": "FAQ's", "link": "about/faqs"}
14+
{"name": "FAQ's", "link": "about/faqs"},
15+
{"name": "Job Board", "link": "about/job-board"}
1516
]
1617
},
1718
{

src/job-board.njk renamed to src/about/job-board.njk

Lines changed: 11 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,92 +6,26 @@ layout: base.njk
66

77
{% from "components/flat-card.njk" import flatCard %}
88
{% from "components/button.njk" import button %}
9+
{% set job_postings = jobData %}
910

10-
{% set job_postings = [
11-
{
12-
"title": "Full Stack Engineer",
13-
"company": "Free Jobs.In",
14-
"company_website": "google.com",
15-
"job_type": "Full Time",
16-
"location": "Bangalore",
17-
"description": "If you need free jobs please apply. Please refer to the website for the detailed Job Description by clicking on the Job application link.",
18-
"link_to_apply": "www.google.com"
19-
},
20-
{
21-
"title": "Full Stack Engineer",
22-
"company": "Free Jobs.In",
23-
"company_website": "google.com",
24-
"job_type": "Full Time",
25-
"location": "Bangalore",
26-
"description": "If you need free jobs please apply.",
27-
"link_to_apply": "www.google.com"
28-
},
29-
{
30-
"title": "Full Stack Engineer",
31-
"company": "Free Jobs.In",
32-
"company_website": "google.com",
33-
"job_type": "Full Time",
34-
"location": "Bangalore",
35-
"description": "If you need free jobs please apply.",
36-
"link_to_apply": "www.google.com"
37-
},
38-
{
39-
"title": "Full Stack Engineer",
40-
"company": "Free Jobs.In",
41-
"company_website": "google.com",
42-
"job_type": "Full Time",
43-
"location": "Bangalore",
44-
"description": "If you need free jobs please apply.",
45-
"link_to_apply": "www.google.com"
46-
},
47-
{
48-
"title": "Full Stack Engineer",
49-
"company": "Free Jobs.In",
50-
"company_website": "google.com",
51-
"job_type": "Full Time",
52-
"location": "Bangalore",
53-
"description": "If you need free jobs please apply.",
54-
"link_to_apply": "www.google.com"
55-
},
56-
{
57-
"title": "Full Stack Engineer",
58-
"company": "Free Jobs.In",
59-
"company_website": "google.com",
60-
"job_type": "Full Time",
61-
"location": "Bangalore",
62-
"description": "If you need free jobs please apply.",
63-
"link_to_apply": "www.google.com"
64-
},
65-
{
66-
"title": "Full Stack Engineer",
67-
"company": "Free Jobs.In",
68-
"company_website": "google.com",
69-
"job_type": "Full Time",
70-
"location": "Bangalore",
71-
"description": "If you need free jobs please apply.",
72-
"link_to_apply": "www.google.com"
73-
}
74-
]
75-
%}
76-
77-
<div class="w-full h-auto bg-lavender px-[6%] flex flex-col md:flex-row pb-40 relative">
11+
<div class="w-full h-auto bg-pycon-blue px-[6%] pb-32 flex flex-col md:flex-row">
7812
<div class="pt-32 pb-8 md:pb-32 w-full lg:w-[70%]">
79-
<div class="black-han-sans-regular font-normal text-3xl md:text-5xl md:text-center text-black text-center lg:text-left">
13+
<div class="black-han-sans-regular font-normal text-4xl md:text-5xl md:text-center text-[#FFFFFF] text-center lg:text-left">
8014
Job Board
8115
</div>
82-
<div class="pt-10 font-light text-lg md:text-2xl md:text-center text-black text-center lg:text-left">
83-
<p>Submit your job posting <a href="" class="underline">here</a></p>
16+
<div class="pt-10 font-light text-lg md:text-2xl md:text-center text-white text-center lg:text-left">
17+
<p class="mb-0">Submit your job posting <a href="https://docs.google.com/forms/d/e/1FAIpQLSce8d2wOm976llzPUlF3NXzfx4K7zPamnxHSGWup1HDKMA-3g/viewform?usp=dialog" target="_blank" rel="noopener noreferrer" class="underline">here</a></p>
8418
<p>Check out the <a href="{{ env.baseUrl }}job-board-rules-and-guidelines/" class="underline">rules and guidelines</a> </p>
8519
</div>
8620
</div>
8721
<div class="lg:w-[30%] w-[80%] lg:mt-40 flex items-center justify-center mx-auto">
88-
<img src="/img/assets/aircraft.svg" alt="Guide" class="w-[40%] lg:w-[60%] transition-transform duration-100" style="animation: floating 2s ease-in-out infinite;">
89-
<img src="/img/assets/planet.svg" alt="Guide" class="w-[40%] lg:w-[60%] transition-transform duration-100" style="animation: floating 2s ease-in-out infinite;">
22+
<img src="/img/assets/abstract-obj.svg" alt="Guide" class="w-[40%] lg:w-[60%] transition-transform duration-100" style="animation: floating 2s ease-in-out infinite;">
23+
<img src="/img/assets/star-lime-vector.svg" alt="Guide" class="w-[10%] lg:w-[10%] transition-transform duration-100" style="animation: floating 2s ease-in-out infinite;">
9024
</div>
9125
</div>
9226

9327

94-
<div class="main-container bg-lavender w-full h-auto px-[6%] pb-52 md:pb-40 relative">
28+
<div class="job-container bg-lavender w-full h-auto -pt-20 px-[6%] pb-72 md:pb-40 relative">
9529
<div class="flex flex-wrap -mt-24 -mx-4">
9630
<!-- Column 1 -->
9731
<div class="w-full lg:w-1/3 px-4 flex flex-col gap-8">
@@ -198,4 +132,6 @@ layout: base.njk
198132
{% endfor %}
199133
</div>
200134
</div>
201-
</div>
135+
</div>
136+
137+
<script></script>
Lines changed: 15 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)