From cf868212036b17d60fca4bee18b3455d1e3b9515 Mon Sep 17 00:00:00 2001 From: ekrishnachaitanya2004 Date: Sun, 25 May 2025 21:28:10 +0530 Subject: [PATCH 1/5] changes to resolve build issue --- netlify.toml | 11 +++- scripts/jsonGenerator.js | 96 +++++++++++++++++++++------------ src/content/blog/english/khc.md | 49 +++++++++++++++++ 3 files changed, 121 insertions(+), 35 deletions(-) create mode 100644 src/content/blog/english/khc.md diff --git a/netlify.toml b/netlify.toml index 4b04bea..ee6c4c7 100755 --- a/netlify.toml +++ b/netlify.toml @@ -1,6 +1,15 @@ [build] publish = "dist" -command = "yarn build" +command = "yarn generate-json && yarn build" [build.environment] NODE_VERSION = "20" +DEBUG = "*" + +[[plugins]] +package = "@netlify/plugin-functions-core" + [plugins.inputs] + functionsDirectory = "netlify/functions" + +[functions] +node_bundler = "esbuild" diff --git a/scripts/jsonGenerator.js b/scripts/jsonGenerator.js index 5881da2..b81214c 100644 --- a/scripts/jsonGenerator.js +++ b/scripts/jsonGenerator.js @@ -10,10 +10,20 @@ const BLOG_FOLDER = "blog"; // get data from markdown const getData = (folder, groupDepth, langIndex = 0) => { + console.log(`Processing folder: ${folder}`); + const getPaths = languages .map((lang, index) => { const langFolder = lang.contentDir ? lang.contentDir : lang.languageCode; const dir = path.join(CONTENT_ROOT, folder, langFolder); + + console.log(`Checking directory: ${dir}`); + + if (!fs.existsSync(dir)) { + console.warn(`Directory does not exist: ${dir}`); + return []; + } + return fs .readdirSync(dir) .filter( @@ -23,38 +33,45 @@ const getData = (folder, groupDepth, langIndex = 0) => { ) .flatMap((filename) => { const filepath = path.join(dir, filename); - const stats = fs.statSync(filepath); - const isFolder = stats.isDirectory(); + console.log(`Processing file: ${filepath}`); + + try { + const stats = fs.statSync(filepath); + const isFolder = stats.isDirectory(); - if (isFolder) { - return getData(filepath, groupDepth, index); - } else { - const file = fs.readFileSync(filepath, "utf-8"); - const { data, content } = matter(file); - const pathParts = filepath.split(path.sep); - - let slug; - if (data.slug) { - const slugParts = data.slug.split("/"); - slugParts[0] = BLOG_FOLDER; - slug = slugParts.join("/"); + if (isFolder) { + return getData(filepath, groupDepth, index); } else { - slug = pathParts - .slice(CONTENT_DEPTH) - .join("/") - .replace(/\.[^/.]+$/, ""); - slug = `${BLOG_FOLDER}/${slug.split("/").slice(1).join("/")}`; - } - data.slug = slug; - const group = "blog"; + const file = fs.readFileSync(filepath, "utf-8"); + const { data, content } = matter(file); + const pathParts = filepath.split(path.sep); + + let slug; + if (data.slug) { + const slugParts = data.slug.split("/"); + slugParts[0] = BLOG_FOLDER; + slug = slugParts.join("/"); + } else { + slug = pathParts + .slice(CONTENT_DEPTH) + .join("/") + .replace(/\.[^/.]+$/, ""); + slug = `${BLOG_FOLDER}/${slug.split("/").slice(1).join("/")}`; + } + data.slug = slug; + const group = "blog"; - return { - lang: languages[index].languageCode, // Set the correct language code dynamically - group: group, - slug: data.slug, - frontmatter: data, - content: content, - }; + return { + lang: languages[index].languageCode, + group: group, + slug: data.slug, + frontmatter: data, + content: content, + }; + } + } catch (error) { + console.error(`Error processing file ${filepath}:`, error); + return []; } }); }) @@ -65,21 +82,32 @@ const getData = (folder, groupDepth, langIndex = 0) => { }; try { + console.log("Starting JSON generation..."); + // create folder if it doesn't exist if (!fs.existsSync(JSON_FOLDER)) { - fs.mkdirSync(JSON_FOLDER); + console.log(`Creating JSON folder: ${JSON_FOLDER}`); + fs.mkdirSync(JSON_FOLDER, { recursive: true }); } // create json files + const posts = getData(BLOG_FOLDER, 3); + console.log(`Generated ${posts.length} posts`); + fs.writeFileSync( `${JSON_FOLDER}/posts.json`, - JSON.stringify(getData(BLOG_FOLDER, 3)), + JSON.stringify(posts, null, 2) ); // merge json files for search - const posts = require(`../${JSON_FOLDER}/posts.json`); const search = [...posts]; - fs.writeFileSync(`${JSON_FOLDER}/search.json`, JSON.stringify(search)); + fs.writeFileSync( + `${JSON_FOLDER}/search.json`, + JSON.stringify(search, null, 2) + ); + + console.log("JSON generation completed successfully"); } catch (err) { - console.error(err); + console.error("Error during JSON generation:", err); + process.exit(1); } diff --git a/src/content/blog/english/khc.md b/src/content/blog/english/khc.md new file mode 100644 index 0000000..2cce5f8 --- /dev/null +++ b/src/content/blog/english/khc.md @@ -0,0 +1,49 @@ +--- +title: "Inside SRM-RMP Chennai: Stories Students Whisper, But Never Post" +meta_title: "The Unspoken Reality Behind SRM Ramapuram Campus" +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." +date: 2024-08-25T16:10:00 +image: "https://srmrmp.edu.in/wp-content/uploads/2023/08/IST-1.jpg" +categories: + [ + "Education", + "College Life", + "Student Experiences", + "India", + "Truth Behind Brochures", + ] +author: "Harshi Chowdary Kanderi" +tags: + [ + "SRM", + "Ramapuram", + "Student Voices", + "College Life India", + "Campus Reality", + ] +draft: false +--- + +## Inside SRM-RMP Chennai: Stories Students Whisper, But Never Post + +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…”* + +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.” + +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. + +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. + +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. + +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. + +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. + +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. + +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. + +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. + +--- \ No newline at end of file From afb2c64168d036100b4063ae11c352139223a613 Mon Sep 17 00:00:00 2001 From: ekrishnachaitanya2004 Date: Sun, 25 May 2025 21:33:11 +0530 Subject: [PATCH 2/5] Update Netlify and Astro configuration for better deployment --- astro.config.mjs | 10 ++++++++++ netlify.toml | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index 0409e02..0ba548f 100755 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -23,6 +23,7 @@ export default defineConfig({ site: config.site.base_url ? config.site.base_url : "http://examplesite.com", base: config.site.base_path ? config.site.base_path : "/", trailingSlash: config.site.trailing_slash ? "always" : "ignore", + output: "static", i18n: { locales: filteredSupportedLang, defaultLocale: default_language, @@ -65,4 +66,13 @@ export default defineConfig({ }, extendDefaultPlugins: true, }, + vite: { + build: { + sourcemap: false, + minify: true, + }, + ssr: { + noExternal: ['@astrojs/*'], + }, + }, }); diff --git a/netlify.toml b/netlify.toml index ee6c4c7..dfc9cd1 100755 --- a/netlify.toml +++ b/netlify.toml @@ -1,10 +1,12 @@ [build] publish = "dist" -command = "yarn generate-json && yarn build" +command = "yarn install && yarn generate-json && yarn build" [build.environment] NODE_VERSION = "20" DEBUG = "*" +NODE_ENV = "production" +YARN_FLAGS = "--frozen-lockfile" [[plugins]] package = "@netlify/plugin-functions-core" @@ -13,3 +15,8 @@ package = "@netlify/plugin-functions-core" [functions] node_bundler = "esbuild" + +[[redirects]] +from = "/*" +to = "/index.html" +status = 200 From 7e0bee9e9d341017af92fbb6aea2590503755f6c Mon Sep 17 00:00:00 2001 From: ekrishnachaitanya2004 Date: Sun, 25 May 2025 21:35:08 +0530 Subject: [PATCH 3/5] Optimize build configuration for Netlify deployment --- astro.config.mjs | 13 +++++++++++-- netlify.toml | 19 +++++++++---------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 0ba548f..efdc23c 100755 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -24,6 +24,10 @@ export default defineConfig({ base: config.site.base_path ? config.site.base_path : "/", trailingSlash: config.site.trailing_slash ? "always" : "ignore", output: "static", + build: { + format: 'directory', + assets: '_assets', + }, i18n: { locales: filteredSupportedLang, defaultLocale: default_language, @@ -70,9 +74,14 @@ export default defineConfig({ build: { sourcemap: false, minify: true, + rollupOptions: { + output: { + manualChunks: undefined, + }, + }, }, - ssr: { - noExternal: ['@astrojs/*'], + optimizeDeps: { + exclude: ['@astrojs/mdx'], }, }, }); diff --git a/netlify.toml b/netlify.toml index dfc9cd1..cc6b467 100755 --- a/netlify.toml +++ b/netlify.toml @@ -1,22 +1,21 @@ [build] publish = "dist" -command = "yarn install && yarn generate-json && yarn build" +command = "yarn install --frozen-lockfile && yarn generate-json && yarn build" [build.environment] NODE_VERSION = "20" -DEBUG = "*" NODE_ENV = "production" YARN_FLAGS = "--frozen-lockfile" -[[plugins]] -package = "@netlify/plugin-functions-core" - [plugins.inputs] - functionsDirectory = "netlify/functions" - -[functions] -node_bundler = "esbuild" - [[redirects]] from = "/*" to = "/index.html" status = 200 + +[[headers]] + for = "/*" + [headers.values] + X-Frame-Options = "DENY" + X-XSS-Protection = "1; mode=block" + X-Content-Type-Options = "nosniff" + Referrer-Policy = "strict-origin-when-cross-origin" From 02398174f818f6cb7331bbef4b4cf1b12109b33d Mon Sep 17 00:00:00 2001 From: ekrishnachaitanya2004 Date: Sun, 25 May 2025 21:41:48 +0530 Subject: [PATCH 4/5] Remove Netlify functions plugin for static site deployment --- netlify.toml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/netlify.toml b/netlify.toml index cc6b467..22e0cdc 100755 --- a/netlify.toml +++ b/netlify.toml @@ -1,21 +1,6 @@ [build] -publish = "dist" -command = "yarn install --frozen-lockfile && yarn generate-json && yarn build" + command = "yarn generate-json && astro build" + publish = "dist" -[build.environment] -NODE_VERSION = "20" -NODE_ENV = "production" -YARN_FLAGS = "--frozen-lockfile" - -[[redirects]] -from = "/*" -to = "/index.html" -status = 200 - -[[headers]] - for = "/*" - [headers.values] - X-Frame-Options = "DENY" - X-XSS-Protection = "1; mode=block" - X-Content-Type-Options = "nosniff" - Referrer-Policy = "strict-origin-when-cross-origin" +[build.processing] + skip_processing = true \ No newline at end of file From 2031c1e92422099190398ec51b5c4ae01215d1da Mon Sep 17 00:00:00 2001 From: ekrishnachaitanya2004 Date: Sun, 25 May 2025 21:45:07 +0530 Subject: [PATCH 5/5] Fix react-lite-youtube-embed bundling and optimize build configuration --- astro.config.mjs | 8 +++++++- netlify.toml | 23 +++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index efdc23c..3932dc4 100755 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -36,7 +36,9 @@ export default defineConfig({ service: squooshImageService(), }, integrations: [ - react(), + react({ + include: ['**/Youtube.tsx', '**/*.tsx'], + }), sitemap(), tailwind({ applyBaseStyles: false, @@ -81,7 +83,11 @@ export default defineConfig({ }, }, optimizeDeps: { + include: ['react-lite-youtube-embed'], exclude: ['@astrojs/mdx'], }, + ssr: { + noExternal: ['react-lite-youtube-embed'], + }, }, }); diff --git a/netlify.toml b/netlify.toml index 22e0cdc..9b42001 100755 --- a/netlify.toml +++ b/netlify.toml @@ -1,6 +1,25 @@ [build] - command = "yarn generate-json && astro build" + command = "yarn install --frozen-lockfile && yarn generate-json && yarn build" publish = "dist" +[build.environment] +NODE_VERSION = "20" +NODE_ENV = "production" +YARN_FLAGS = "--frozen-lockfile" +NETLIFY_USE_YARN = "true" + [build.processing] - skip_processing = true \ No newline at end of file + skip_processing = false + +[[redirects]] +from = "/*" +to = "/index.html" +status = 200 + +[[headers]] + for = "/*" + [headers.values] + X-Frame-Options = "DENY" + X-XSS-Protection = "1; mode=block" + X-Content-Type-Options = "nosniff" + Referrer-Policy = "strict-origin-when-cross-origin" \ No newline at end of file