Skip to content

fix: resolve LFX program page content rendering#7518

Open
rishiraj38 wants to merge 1 commit intolayer5io:masterfrom
rishiraj38:fix/lfx-program-page
Open

fix: resolve LFX program page content rendering#7518
rishiraj38 wants to merge 1 commit intolayer5io:masterfrom
rishiraj38:fix/lfx-program-page

Conversation

@rishiraj38
Copy link
Contributor

@rishiraj38 rishiraj38 commented Mar 18, 2026

Description

This PR Fixes an issue where /programs/lfx was showing the 2026 title but old 2025/2024 content.

Before:

gatsby-node.js was creating a /programs/lfx page for every single year in a loop, so the content was getting randomly overwritten and stuck on whatever file finished last.

After:
We now use a Map to group the files by slug, explicitly pick the newest year (like 2026), and generate the page only once. We also pass the slug to the React component to keep the dropdown UI and markdown perfectly in sync.

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
@l5io
Copy link
Member

l5io commented Mar 18, 2026

🚀 Preview for commit 2d9ce49 at: https://69ba6d436673b75952eca60f--layer5.netlify.app

Copy link
Contributor

@YASHMAHAKAL YASHMAHAKAL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rishiraj38 When using string comparison (>) works for cases like lfx-2024 vs lfx-2023, it breaks when comparing versioned vs un-versioned slugs.

For example, in JavaScript, "/programs/gsod-2024/" > "/programs/gsod/" evaluates to false (because - has a lower char code than /). This causes the older gsod page to incorrectly be set as the "latest" over gsod-2024.

@YASHMAHAKAL
Copy link
Contributor

@rishiraj38 i again verified my suggestion and i think your changes are correct. I didn't account for the fact that the slug strings don't have trailing slashes. Because of that, "/programs/gsod-2024" > "/programs/gsod" actually does evaluate to true in Javascript, so this logic perfectly solves the issue.

@rishiraj38
Copy link
Contributor Author

rishiraj38 commented Mar 18, 2026

@rishiraj38 i again verified my suggestion and i think your changes are correct. I didn't account for the fact that the slug strings don't have trailing slashes. Because of that, "/programs/gsod-2024" > "/programs/gsod" actually does evaluate to true in Javascript, so this logic perfectly solves the issue.

For better and safer results, I believe I should parse it and then compare it to determine the latest slug. What are your thoughts? @YASHMAHAKAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants