Fix issue #524: Updating robots.txt with Sitemap

This commit is contained in:
prototypa
2024-10-04 02:27:24 -04:00
parent 6fde4b0450
commit d942f2b9f6

View File

@@ -95,7 +95,7 @@ export default ({ config: _themeConfig = 'src/config.yaml' } = {}): AstroIntegra
const pattern = /^Sitemap:(.*)$/m;
if (!pattern.test(robotsTxt)) {
fs.appendFileSync(robotsTxtFileInOut, `${os.EOL}${os.EOL}Sitemap: ${sitemapUrl}`, {
fs.writeFileSync(robotsTxtFileInOut, `${robotsTxt}${os.EOL}${os.EOL}Sitemap: ${sitemapUrl}`, {
encoding: 'utf8',
flag: 'w',
});