feat(seo): include active trade listings in the sitemap - #422
Open
Hey-Yetunde wants to merge 1 commit into
Open
Hey-Yetunde wants to merge 1 commit into
Hey-Yetunde wants to merge 1 commit into
Conversation
|
@Hey-Yetunde Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #381
Summary
frontend/app/sitemap.tsnow fetches the active trade listings and appends their/trades/<id>URLs, so search engines can discover and index individual trade pages.Changes (
frontend/app/sitemap.ts)sitemap()is now an async route handler that returns the staticPUBLIC_ROUTESplus dynamic trade entries.${NEXT_PUBLIC_API_URL ?? http://localhost:3001}/api/v1/trades?page=&limit=), the same endpoint the home page uses. Up to 5 pages × 100 are pulled for a bounded sitemap.status === "Active"trades are included.trade.updated_ataslastModified(/trades/<id>,changeFrequency: "daily",priority: 0.6).export const revalidate = 900(15 minutes) and the fetch carriesnext: { revalidate: 900 }, so the sitemap regenerates on each revalidation cycle.Tests (
frontend/app/lib/seo.test.ts)sitemap trade listings (Issue #381):includes active trade URLs with lastmod from updated_at— asserts a dynamic/trades/trade-1URL is present, that aCompletedtrade is excluded, and thatlastModifiedequals the trade'supdated_at.degrades to static routes when the listing API fails— asserts the static/remains and no/trades/entry is emitted.Verification
npx jest app/lib/seo.test.ts→ 16 passed.npx tsc --noEmit→ no errors in the changed files (3 pre-existing errors elsewhere).