fix(frontend): resolve PWA manifest, metadata, and SEO issues#1291
Merged
Conversation
…issues This commit addresses four interconnected frontend SEO and PWA issues: 1. **PWA Manifest Icons (Issue LabsCrypt#1240)**: Update manifest.webmanifest to reference existing .svg icon files (/icons/icon-192x192.svg and /icons/icon-512x512.svg) with correct image/svg+xml MIME type instead of non-existent .png files. 2. **Page Metadata for kingdom & liquidations (Issue LabsCrypt#1239)**: Add generateMetadata exports to kingdom/page.tsx and liquidations/page.tsx, following the existing loans/lend pattern to ensure unique titles, descriptions, and canonical links are emitted for these indexable pages. 3. **hreflang Alternates (Issue LabsCrypt#1237)**: Extend buildPageMetadata to include alternates.languages with en/es/tl locale variants and x-default fallback, enabling proper search engine association across language versions. 4. **Consolidated Site Origin (Issue LabsCrypt#1238)**: Unify all SEO-related environment variable usage to NEXT_PUBLIC_APP_URL with consistent default (https://remitlend.com). Extract getSiteUrl() helper in metadata.ts and use it across layout.tsx, robots.ts, and sitemap.ts. Document the variable in .env.example. Changes: - frontend/public/manifest.webmanifest: Icon paths and types corrected - frontend/src/app/lib/metadata.ts: Added LOCALES constant, getSiteUrl export, hreflang alternates, unified env var usage - frontend/src/app/layout.tsx: Import and use getSiteUrl() for metadataBase - frontend/src/app/robots.ts: Use shared getSiteUrl() instead of duplicated logic - frontend/src/app/sitemap.ts: Use shared getSiteUrl() instead of duplicated logic - frontend/src/app/[locale]/kingdom/page.tsx: Add generateMetadata - frontend/src/app/[locale]/liquidations/page.tsx: Add generateMetadata - frontend/.env.example: Document NEXT_PUBLIC_APP_URL with context Closes LabsCrypt#1240 LabsCrypt#1239 LabsCrypt#1237 LabsCrypt#1238 Co-Authored-By: Remitlend Contributors <open-source@remitlend.com>
3 tasks
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.
Summary
Comprehensive fix for four interconnected frontend SEO and PWA configuration issues. All manifest, metadata, and environment variable inconsistencies are now resolved with consolidated site origin handling and proper hreflang language alternates.
Issues Closed
Closes #1240 - PWA manifest references /icons/icon-192x192.png and 512.png but files on disk are .svg
Fix: Updated
manifest.webmanifestto reference existing SVG files with correct MIME types./icons/icon-192x192.png→/icons/icon-192x192.svg/icons/icon-512x512.png→/icons/icon-512x512.svgimage/png→image/svg+xmlCloses #1239 - Sitemap-listed indexable pages kingdom and liquidations have no generateMetadata
Fix: Added
generateMetadataexports to both pages following loans/lend pattern.frontend/src/app/[locale]/kingdom/page.tsx:frontend/src/app/[locale]/liquidations/page.tsx:Closes #1237 - buildPageMetadata sets canonical but no hreflang alternates
Fix: Extended
buildPageMetadata()to generate hreflang language links.["en", "es", "tl"]alternates.languageswith full URLs for each localex-defaultfallback pointing to/envariantCloses #1238 - SEO site origin read from two different env vars with mismatched defaults
Fix: Consolidated all SEO environment variables to single
NEXT_PUBLIC_APP_URL.getSiteUrl()helper function inmetadata.tslayout.tsxto usegetSiteUrl()for metadataBaserobots.tsto usegetSiteUrl()instead of duplicated logicsitemap.tsto usegetSiteUrl()instead of duplicated logichttps://remitlend.com(production consistent across all files)NEXT_PUBLIC_APP_URLinfrontend/.env.exampleFiles Modified
frontend/public/manifest.webmanifestfrontend/src/app/lib/metadata.tsfrontend/src/app/layout.tsxfrontend/src/app/robots.tsfrontend/src/app/sitemap.tsfrontend/src/app/[locale]/kingdom/page.tsxfrontend/src/app/[locale]/liquidations/page.tsxfrontend/.env.exampleCode Quality