lib/robots/core
Functions
'Read the “', Functions, '” section'generateContent()
'Read the “', generateContent(), '” section'function generateContent( config: RobotsConfig, siteMapHref: string, logger: AstroIntegrationLogger): string
Defined in: studiocms/packages/studiocms/src/lib/robots/core.ts:172
Generates the content for the robots.txt file based on the provided configuration.
Parameters
'Read the “', Parameters, '” section'The configuration object for generating the robots.txt content.
siteMapHref
'Read the “', siteMapHref, '” section'string
The URL of the sitemap.
AstroIntegrationLogger
The logger instance for logging messages.
string
The generated content for the robots.txt file.
Will throw an error if any policy is missing a required userAgent, if both allow and disallow entries are missing or empty, if crawlDelay is not a number or is out of the allowed range (0.1 to 60 seconds).
printInfo()
'Read the “', printInfo(), '” section'function printInfo( fileSize: number, executionTime: number, logger: AstroIntegrationLogger, destDir: string): void
Defined in: studiocms/packages/studiocms/src/lib/robots/core.ts:285
Prints information about the generation of the ‘robots.txt’ file.
Parameters
'Read the “', Parameters, '” section'number
The size of the generated ‘robots.txt’ file in KB.
executionTime
'Read the “', executionTime, '” section'number
The time taken to generate the ‘robots.txt’ file in milliseconds.
AstroIntegrationLogger
The logger instance used to log information.
string
The destination directory where the ‘robots.txt’ file is created.
void