@@ -14,7 +14,7 @@ import {
1414 makeS3Client ,
1515 putS3File ,
1616} from '../helpers/s3Bucket.helper' ;
17- import { PutObjectCommand , S3Client } from '@aws-sdk/client-s3' ;
17+ import { S3Client } from '@aws-sdk/client-s3' ;
1818import { extractTitleFromMarkdown } from '../helpers/extractTitle.helper' ;
1919import { fetchFromStrapi } from '../helpers/fetchFromStrapi' ;
2020import { MetadataInfo , MetadataType } from '../helpers/guidesMetadataHelper' ;
@@ -27,7 +27,6 @@ import {
2727 getSyncedSolutionsResponseJsonPath ,
2828} from '../syncedResponses' ;
2929import { DOCUMENTATION_PATH } from '../helpers/documentationParsing.helper' ;
30- import { baseUrl } from 'nextjs-website/src/config' ;
3130import {
3231 StrapiApiData ,
3332 StrapiGuide ,
@@ -95,9 +94,6 @@ const S3_RELEASE_NOTES_DIRNAMES_JSON_PATH =
9594 process . env . S3_RELEASE_NOTES_DIRNAMES_JSON_PATH ||
9695 'release-notes-dirNames.json' ;
9796
98- const SITEMAP_URL = process . env . SITEMAP_URL || `${ baseUrl } /sitemap.xml` ;
99- const S3_SITEMAP_PATH = process . env . S3_SITEMAP_PATH || 'sitemap.xml' ;
100-
10197const DOCUMENTATION_ABSOLUTE_PATH = path . resolve ( DOCUMENTATION_PATH ) ;
10298
10399interface StrapiData {
@@ -199,19 +195,6 @@ async function fetchAllStrapiData(): Promise<StrapiData> {
199195 } ;
200196}
201197
202- async function fetchSitemapXml ( ) : Promise < string > {
203- console . log ( `Fetching sitemap from ${ SITEMAP_URL } ...` ) ;
204- const response = await fetch ( SITEMAP_URL ) ;
205- if ( ! response . ok ) {
206- // eslint
207- // eslint-disable-next-line functional/no-throw-statements
208- throw new Error (
209- `Failed to fetch sitemap: ${ response . status } ${ response . statusText } `
210- ) ;
211- }
212- return await response . text ( ) ;
213- }
214-
215198// Generate URL path helper functions
216199function generateUrlPath (
217200 filePath : string ,
@@ -647,15 +630,6 @@ async function main() {
647630 S3_BUCKET_NAME ! ,
648631 getS3Client ( )
649632 ) ;
650- const sitemapXml = await fetchSitemapXml ( ) ;
651-
652- await getS3Client ( ) . send (
653- new PutObjectCommand ( {
654- Bucket : `${ S3_BUCKET_NAME } ` ,
655- Key : S3_SITEMAP_PATH ,
656- Body : sitemapXml ,
657- } )
658- ) ;
659633 }
660634
661635 // Save synced responses
0 commit comments