add DEV_MODE support to metadata generation and robots handling; update .gitignore and docker-compose for environment variables

This commit is contained in:
2025-10-11 15:26:26 +03:30
parent f47eb03879
commit 305d79d5f4
5 changed files with 42 additions and 1 deletions
+17
View File
@@ -28,6 +28,23 @@ export async function generateMetadata() {
},
};
// Add noindex meta tag when DEV_MODE is TRUE
if (process.env.DEV_MODE === 'TRUE') {
baseMetadata.robots = {
index: false,
follow: false,
nocache: true,
googleBot: {
index: false,
follow: false,
noimageindex: true,
'max-video-preview': -1,
'max-image-preview': 'large',
'max-snippet': -1,
},
};
}
// Add canonical URL only if we're not on the main domain and matchedCity domain is not nobat724.com
if (canonicalUrl && (!matchedCity || matchedCity.domain !== 'nobat724.com')) {
baseMetadata.alternates = {
+11
View File
@@ -22,6 +22,17 @@ export default function robots() {
const domain = getCurrentDomain();
const baseUrl = getBaseUrl(domain);
// If DEV_MODE is TRUE, disallow all crawlers
if (process.env.DEV_MODE === 'TRUE') {
return {
rules: {
userAgent: '*',
disallow: '/',
},
};
}
// Normal behavior when DEV_MODE is FALSE or not set
return {
rules: {
userAgent: '*',