File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import starlight from '@astrojs/starlight';
44import mtasaStarlightThemePlugin from '@multitheftauto/starlight-theme-mtasa' ;
55import { SITE_TITLE , SITE_URL , SITE_PREVIEW_URL } from './src/content.constants' ;
66
7- const isDeploy = process . env . CI === 'true' ;
7+ const isDeploy = process . env . CI === 'true' && process . env . CI_PREVIEW !== 'true' ;
88const siteBaseUrl = isDeploy ? SITE_URL : SITE_PREVIEW_URL ;
99
1010export default defineConfig ( {
Original file line number Diff line number Diff line change 11import type { APIRoute } from 'astro' ;
22
3- const getRobotsTxt = ( sitemapURL : URL ) => `
4- User-agent: *
5- Allow: /
3+ const getRobotsTxt = ( sitemapURL : URL ) => {
4+ let previewToggle = sitemapURL . href . includes ( '.preview.' ) ? 'Disallow' : 'Allow' ;
5+ return `User-agent: *
6+ ${ previewToggle } : /
67
78Sitemap: ${ sitemapURL . href }
89` ;
10+ }
911
1012export const GET : APIRoute = ( { site } ) => {
1113 const sitemapURL = new URL ( 'sitemap-index.xml' , site ) ;
You can’t perform that action at this time.
0 commit comments