Skip to content

feat: remove unused static pages #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2025
Merged

Conversation

chinhld12
Copy link
Collaborator

What's this PR do?

  • remove unused static pages

Key changes include:

  • Centralized Path Management: Introduced getStaticJSONPaths in src/lib/content/paths.ts to consolidate the handling of markdown files, aliases, and redirects, serving as the primary source for page generation.
  • Simplified Page Generation: The getStaticPaths and getStaticProps functions in src/pages/[...slug].tsx were significantly refactored to use getStaticJSONPaths, streamlining the process of determining which pages to build and how to fetch their content. This replaces more complex logic that previously handled markdown files, aliases, and redirects separately.
  • Updated Helper Scripts: scripts/common.ts was modified to support the new path logic, including changes to how aliases and redirects are processed and the removal of the unused execPromise function. A new getNginxRedirects function was also added.
  • Redirect Handling in UI: The transformMenuDataToDirectoryTree function in src/lib/content/utils.ts now uses the static paths to correctly resolve URLs for menu items, ensuring links point to the correct final destinations after considering aliases and redirects.

@railway-app railway-app bot temporarily deployed to memo.d.foundation-pr-193 May 27, 2025 14:16 Destroyed
Copy link

railway-app bot commented May 27, 2025

🚅 Deployed to the memo.d.foundation-pr-193 environment in memo.d.foundation

Service Status Web Updated (UTC)
memo.d.foundation ◻️ Removed (View Logs) Web May 28, 2025 at 1:08 pm

@railway-app railway-app bot temporarily deployed to memo.d.foundation-pr-193 May 27, 2025 14:37 Destroyed
@chinhld12 chinhld12 force-pushed the feat/remove-unused-static-pages branch from bc0f68b to 1973207 Compare May 27, 2025 14:55
@railway-app railway-app bot temporarily deployed to memo.d.foundation-pr-193 May 27, 2025 14:55 Destroyed
@chinhld12 chinhld12 force-pushed the feat/remove-unused-static-pages branch from 1973207 to 12548ab Compare May 28, 2025 08:04
@railway-app railway-app bot temporarily deployed to memo.d.foundation-pr-193 May 28, 2025 08:04 Destroyed
@railway-app railway-app bot temporarily deployed to memo.d.foundation-pr-193 May 28, 2025 08:50 Destroyed
@chinhld12 chinhld12 requested a review from zlatanpham May 28, 2025 10:33
@zlatanpham zlatanpham merged commit e543e28 into main May 28, 2025
1 check passed
@zlatanpham zlatanpham deleted the feat/remove-unused-static-pages branch May 28, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants