Skip to content

Commit cf86821

Browse files
changes to resolve build issue
1 parent 92c2cc4 commit cf86821

File tree

3 files changed

+121
-35
lines changed

3 files changed

+121
-35
lines changed

netlify.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
[build]
22
publish = "dist"
3-
command = "yarn build"
3+
command = "yarn generate-json && yarn build"
44

55
[build.environment]
66
NODE_VERSION = "20"
7+
DEBUG = "*"
8+
9+
[[plugins]]
10+
package = "@netlify/plugin-functions-core"
11+
[plugins.inputs]
12+
functionsDirectory = "netlify/functions"
13+
14+
[functions]
15+
node_bundler = "esbuild"

scripts/jsonGenerator.js

Lines changed: 62 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@ const BLOG_FOLDER = "blog";
1010

1111
// get data from markdown
1212
const getData = (folder, groupDepth, langIndex = 0) => {
13+
console.log(`Processing folder: ${folder}`);
14+
1315
const getPaths = languages
1416
.map((lang, index) => {
1517
const langFolder = lang.contentDir ? lang.contentDir : lang.languageCode;
1618
const dir = path.join(CONTENT_ROOT, folder, langFolder);
19+
20+
console.log(`Checking directory: ${dir}`);
21+
22+
if (!fs.existsSync(dir)) {
23+
console.warn(`Directory does not exist: ${dir}`);
24+
return [];
25+
}
26+
1727
return fs
1828
.readdirSync(dir)
1929
.filter(
@@ -23,38 +33,45 @@ const getData = (folder, groupDepth, langIndex = 0) => {
2333
)
2434
.flatMap((filename) => {
2535
const filepath = path.join(dir, filename);
26-
const stats = fs.statSync(filepath);
27-
const isFolder = stats.isDirectory();
36+
console.log(`Processing file: ${filepath}`);
37+
38+
try {
39+
const stats = fs.statSync(filepath);
40+
const isFolder = stats.isDirectory();
2841

29-
if (isFolder) {
30-
return getData(filepath, groupDepth, index);
31-
} else {
32-
const file = fs.readFileSync(filepath, "utf-8");
33-
const { data, content } = matter(file);
34-
const pathParts = filepath.split(path.sep);
35-
36-
let slug;
37-
if (data.slug) {
38-
const slugParts = data.slug.split("/");
39-
slugParts[0] = BLOG_FOLDER;
40-
slug = slugParts.join("/");
42+
if (isFolder) {
43+
return getData(filepath, groupDepth, index);
4144
} else {
42-
slug = pathParts
43-
.slice(CONTENT_DEPTH)
44-
.join("/")
45-
.replace(/\.[^/.]+$/, "");
46-
slug = `${BLOG_FOLDER}/${slug.split("/").slice(1).join("/")}`;
47-
}
48-
data.slug = slug;
49-
const group = "blog";
45+
const file = fs.readFileSync(filepath, "utf-8");
46+
const { data, content } = matter(file);
47+
const pathParts = filepath.split(path.sep);
48+
49+
let slug;
50+
if (data.slug) {
51+
const slugParts = data.slug.split("/");
52+
slugParts[0] = BLOG_FOLDER;
53+
slug = slugParts.join("/");
54+
} else {
55+
slug = pathParts
56+
.slice(CONTENT_DEPTH)
57+
.join("/")
58+
.replace(/\.[^/.]+$/, "");
59+
slug = `${BLOG_FOLDER}/${slug.split("/").slice(1).join("/")}`;
60+
}
61+
data.slug = slug;
62+
const group = "blog";
5063

51-
return {
52-
lang: languages[index].languageCode, // Set the correct language code dynamically
53-
group: group,
54-
slug: data.slug,
55-
frontmatter: data,
56-
content: content,
57-
};
64+
return {
65+
lang: languages[index].languageCode,
66+
group: group,
67+
slug: data.slug,
68+
frontmatter: data,
69+
content: content,
70+
};
71+
}
72+
} catch (error) {
73+
console.error(`Error processing file ${filepath}:`, error);
74+
return [];
5875
}
5976
});
6077
})
@@ -65,21 +82,32 @@ const getData = (folder, groupDepth, langIndex = 0) => {
6582
};
6683

6784
try {
85+
console.log("Starting JSON generation...");
86+
6887
// create folder if it doesn't exist
6988
if (!fs.existsSync(JSON_FOLDER)) {
70-
fs.mkdirSync(JSON_FOLDER);
89+
console.log(`Creating JSON folder: ${JSON_FOLDER}`);
90+
fs.mkdirSync(JSON_FOLDER, { recursive: true });
7191
}
7292

7393
// create json files
94+
const posts = getData(BLOG_FOLDER, 3);
95+
console.log(`Generated ${posts.length} posts`);
96+
7497
fs.writeFileSync(
7598
`${JSON_FOLDER}/posts.json`,
76-
JSON.stringify(getData(BLOG_FOLDER, 3)),
99+
JSON.stringify(posts, null, 2)
77100
);
78101

79102
// merge json files for search
80-
const posts = require(`../${JSON_FOLDER}/posts.json`);
81103
const search = [...posts];
82-
fs.writeFileSync(`${JSON_FOLDER}/search.json`, JSON.stringify(search));
104+
fs.writeFileSync(
105+
`${JSON_FOLDER}/search.json`,
106+
JSON.stringify(search, null, 2)
107+
);
108+
109+
console.log("JSON generation completed successfully");
83110
} catch (err) {
84-
console.error(err);
111+
console.error("Error during JSON generation:", err);
112+
process.exit(1);
85113
}

src/content/blog/english/khc.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: "Inside SRM-RMP Chennai: Stories Students Whisper, But Never Post"
3+
meta_title: "The Unspoken Reality Behind SRM Ramapuram Campus"
4+
description: "A candid, story-style look into what really happens inside SRM Institute's Ramapuram Campus in Chennai. From academic pressure to over-surveillance, here's the version students won’t find in brochures."
5+
date: 2024-08-25T16:10:00
6+
image: "https://srmrmp.edu.in/wp-content/uploads/2023/08/IST-1.jpg"
7+
categories:
8+
[
9+
"Education",
10+
"College Life",
11+
"Student Experiences",
12+
"India",
13+
"Truth Behind Brochures",
14+
]
15+
author: "Harshi Chowdary Kanderi"
16+
tags:
17+
[
18+
"SRM",
19+
"Ramapuram",
20+
"Student Voices",
21+
"College Life India",
22+
"Campus Reality",
23+
]
24+
draft: false
25+
---
26+
27+
## Inside SRM-RMP Chennai: Stories Students Whisper, But Never Post
28+
29+
The first time I walked into SRM Ramapuram campus, it looked like everything I had imagined — polished floors, high-rise buildings, posters of past placement records, and smiling students posing for the university magazine. It had the gloss of a modern private university. But it didn’t take long to realize that behind those shining corridors were stories students only whispered in the quiet corners of the hostel or over DMs that began with, *“Bro, don’t tell anyone I said this…”*
30+
31+
Classes begin like any other college — attendance is taken religiously, sometimes more strictly than actual lectures. Professors walk in with a set of slides that haven’t been updated in years, and most students sit quietly, noting down dictated content like they’re back in high school. You can pass the internal exams easily if you stay in the good books of the faculty — not by being brilliant, but by being obedient. It wasn’t about how much you learned; it was about how well you followed the “system.”
32+
33+
And then there’s attendance. If you miss too many classes, even for genuine reasons, you could be barred from writing your semester exams. There were students who had medical issues or family emergencies, but rules didn’t bend. What’s worse is that some students claimed their attendance was altered — dropped silently after questioning faculty decisions or refusing to participate in mandatory events.
34+
35+
Speaking of which, the word “mandatory” is sacred at SRM-RMP. Whether it’s a cultural fest, a tech summit, or a seminar, students are often **forced** to register. You’re expected to pay fees, attend long sessions, click pictures, and show your face — not for the learning, but for the records. No participation? Get ready for “consequences,” usually in the form of deducted marks or reported disinterest.
36+
37+
The hostel, which was supposed to feel like a second home, often feels more like a monitored facility. Curfews are tight, especially for female students. Hostel wardens inspect rooms without notice, CCTVs watch your movements, and any form of complaint is discouraged with passive threats like *“you might regret escalating this.”* At night, students huddle in groups, not just to chill, but to share survival strategies — which warden to avoid, which faculty not to question, and how to fake enthusiasm during reviews.
38+
39+
Mental health is the invisible elephant in the room. Students break down from pressure, silently. There’s no real counselor system. No trained psychologists. Just teachers who might tell you to “take rest” or “not overthink.” And you don’t dare speak up because the fear of retaliation — through grades, attendance, or public shaming — is very real.
40+
41+
Financially too, SRM-RMP is not cheap. Every certificate, every event, every so-called “extra opportunity” comes with a fee. The institution feels like it’s run more as a business than an academic body. Students are customers, and as long as the payments come in on time, everything else becomes secondary.
42+
43+
But amidst all this, some students still shine. They find loopholes in the system to grow. They use GitHub, contribute to open source, build startups in secret, or prepare for GRE at night when the campus sleeps. SRM doesn’t stop them — but it surely doesn’t help much either. It’s up to the student to *escape the pattern*, and that’s what separates those who merely survive from those who thrive.
44+
45+
So if you're planning to join SRM-RMP, don’t just believe the brochures or the Instagram reels. Talk to alumni, ask tough questions, and most importantly, be mentally prepared. This is a place where you’ll learn — not just subjects, but how to **navigate systems**, deal with pressure, and find your way when the administration doesn’t offer one.
46+
47+
This post isn’t to bash the institution. It’s just the side of the story that doesn't make it to the official website.
48+
49+
---

0 commit comments

Comments
 (0)