diff --git a/package.json b/package.json index 582fbc3..29cbc41 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build && node script/copy-server-config.cjs", "start": "next start", - "lint": "eslint" + "lint": "eslint", + "sitemap": "node script/generate-sitemap.cjs" }, "dependencies": { "@types/leaflet": "^1.9.21", diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..5a5101c --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,80 @@ +# ---------------------------------------------------------------------- +# | Best Match for Next.js Static Export with Trailing Slash | +# ---------------------------------------------------------------------- + + + RewriteEngine On + RewriteBase / + + # -------------------------------------------------------------------- + # | 1. Force HTTPS | + # -------------------------------------------------------------------- + RewriteCond %{HTTPS} off + RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] + + # -------------------------------------------------------------------- + # | 2. Handle Trailing Slashes (Consistent with next.config.ts) | + # -------------------------------------------------------------------- + # If request does NOT end in slash and creates a valid directory, redirect + # This matches Next.js "trailingSlash: true" behavior + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_URI} !index.html + RewriteCond %{REQUEST_URI} !/$ + RewriteRule ^(.*)$ $1/ [L,R=301] + + # -------------------------------------------------------------------- + # | 3. Route to index.html within directories | + # -------------------------------------------------------------------- + # If the request points to a directory that has an index.html, serve it + RewriteCond %{REQUEST_FILENAME} -d + RewriteCond %{REQUEST_FILENAME}/index.html -f + RewriteRule ^(.*)/$ $1/index.html [L] + + # -------------------------------------------------------------------- + # | 4. Fallback for SPA-like refreshing (The "White Screen" Fix) | + # -------------------------------------------------------------------- + # If the file exists, serve it (images, css, js) + RewriteCond %{REQUEST_FILENAME} -f + RewriteRule ^ - [L] + + # If not found, trying appending .html (for flat files) + RewriteCond %{REQUEST_FILENAME}.html -f + RewriteRule ^(.*)$ $1.html [L] + + # If still not found, show Custom 404 Page + # DO NOT fallback to root index.html for non-existent pages (causes soft 404s) + ErrorDocument 404 /404.html + + + +# ---------------------------------------------------------------------- +# | Performance: Compression (Gzip) | +# ---------------------------------------------------------------------- + + AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json application/xml image/svg+xml + + +# ---------------------------------------------------------------------- +# | Performance: Browser Caching | +# ---------------------------------------------------------------------- + + ExpiresActive On + + # Images: 1 Month + ExpiresByType image/jpg "access plus 1 month" + ExpiresByType image/jpeg "access plus 1 month" + ExpiresByType image/gif "access plus 1 month" + ExpiresByType image/png "access plus 1 month" + ExpiresByType image/webp "access plus 1 month" + ExpiresByType image/svg+xml "access plus 1 month" + + # CSS/JS: 1 Year (Immutable if hashed, safe for Next.js) + ExpiresByType text/css "access plus 1 year" + ExpiresByType application/javascript "access plus 1 year" + + # Fonts: 1 Year + ExpiresByType font/woff2 "access plus 1 year" + + # HTML: Short cache to ensure updates are seen + ExpiresByType text/html "access plus 5 minutes" + diff --git a/public/sitemap.xml b/public/sitemap.xml index a5209ad..22cf3fc 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -1 +1 @@ -https://skyandsoil.metatronnest.com/https://skyandsoil.metatronnest.com/about/https://skyandsoil.metatronnest.com/projects/https://skyandsoil.metatronnest.com/residential-real-estate/https://skyandsoil.metatronnest.com/lifestyle/https://skyandsoil.metatronnest.com/contact/https://skyandsoil.metatronnest.com/compare/https://skyandsoil.metatronnest.com/privacy-policy/https://skyandsoil.metatronnest.com/terms-of-service/https://skyandsoil.metatronnest.com/residential-real-estate/barca-at-godrej-msr-city/https://skyandsoil.metatronnest.com/residential-real-estate/godrej-woods/https://skyandsoil.metatronnest.com/residential-real-estate/godrej-hoskote/https://skyandsoil.metatronnest.com/residential-real-estate/godrej-lakeside-orchard/https://skyandsoil.metatronnest.com/residential-real-estate/godrej-tiara/ \ No newline at end of file +http://localhost:3000/http://localhost:3000/about/http://localhost:3000/projects/http://localhost:3000/residential-real-estate/http://localhost:3000/lifestyle/http://localhost:3000/contact/http://localhost:3000/compare/http://localhost:3000/privacy-policy/http://localhost:3000/terms-of-service/http://localhost:3000/residential-real-estate/barca-at-godrej-msr-city/http://localhost:3000/residential-real-estate/godrej-woods/http://localhost:3000/residential-real-estate/godrej-hoskote/http://localhost:3000/residential-real-estate/godrej-lakeside-orchard/http://localhost:3000/residential-real-estate/godrej-tiara/ \ No newline at end of file diff --git a/public/web.config b/public/web.config index 71ac777..22d128c 100644 --- a/public/web.config +++ b/public/web.config @@ -17,10 +17,6 @@ - - - - @@ -28,13 +24,41 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/About.tsx b/src/components/About.tsx index 6ed7004..21d1f38 100644 --- a/src/components/About.tsx +++ b/src/components/About.tsx @@ -69,7 +69,7 @@ export default function About() {
OpenStreetMap contributors' + }); + + // Patch createTile to add unique alt text + const originalCreateTile = (layer as any).createTile; + (layer as any).createTile = function (coords: any, done: any) { + // @ts-ignore - createTile expects a different signature in some type definitions but this is standard Leaflet + const tile = originalCreateTile.call(this, coords, done); + if (tile instanceof HTMLImageElement) { + tile.alt = `Map tile location ${coords.x}, ${coords.y} zoom level ${coords.z}`; + } + return tile; + }; + + layer.addTo(map); + + return () => { + layer.removeFrom(map); + }; + }, [map]); + + return null; +} export default function ConnectivityMap() { const [activeTab, setActiveTab] = useState("Commute"); @@ -213,10 +241,7 @@ export default function ConnectivityMap() { zoomControl={false} ref={setMapRef} > - + diff --git a/src/components/Header.tsx b/src/components/Header.tsx index cec4e13..4ad0c06 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -65,7 +65,7 @@ export default function Header() {
Sky and Soil Logo {`${title}
{property.image.startsWith('/') && ( - {property.title} + {`Main )}
@@ -173,7 +173,7 @@ export default function Properties({ layout = "slider" }: PropertiesProps) {
{property.image.startsWith('/') && ( - {property.title} + {`Main )}
diff --git a/src/components/PropertyCard.tsx b/src/components/PropertyCard.tsx index c702de6..996d44c 100644 --- a/src/components/PropertyCard.tsx +++ b/src/components/PropertyCard.tsx @@ -76,7 +76,7 @@ export default function PropertyCard({ property }: PropertyCardProps) {
{property.title} diff --git a/src/components/PropertyDetailClient.tsx b/src/components/PropertyDetailClient.tsx index 0c6f493..aaea28a 100644 --- a/src/components/PropertyDetailClient.tsx +++ b/src/components/PropertyDetailClient.tsx @@ -558,7 +558,7 @@ export default function PropertyDetailClient({ property }: { property: Property
-
+

{property.title}

@@ -1737,7 +1737,7 @@ export default function PropertyDetailClient({ property }: { property: Property src={property.locality?.mapImage || "/assets/images/map-placeholder.webp"} - alt={`${property.locality?.name} Locality`} + alt={`Map of ${property.locality?.name} Locality`} className="w-full h-full object-cover transition-transform duration-700 group-hover:scale-105" @@ -1853,7 +1853,7 @@ export default function PropertyDetailClient({ property }: { property: Property
- Prestige Raintree Park + Nearby property Prestige Raintree Park
@@ -1879,7 +1879,7 @@ export default function PropertyDetailClient({ property }: { property: Property
- Adarsh Park Heights + Nearby property Adarsh Park Heights
@@ -1905,7 +1905,7 @@ export default function PropertyDetailClient({ property }: { property: Property
- Tru Aquapolis + Nearby property Tru Aquapolis
@@ -1951,9 +1951,9 @@ export default function PropertyDetailClient({ property }: { property: Property {/* FAQ Section */} - + -

Frequently Asked Questions

+

Frequently Asked Questions

@@ -2009,7 +2009,7 @@ export default function PropertyDetailClient({ property }: { property: Property

+ ))}