Skip to content

Commit

Permalink
Merge pull request #56 from kube-HPC/sitemap-copying-via-build
Browse files Browse the repository at this point in the history
copying sitemap
  • Loading branch information
Adir111 authored Nov 11, 2024
2 parents bda5c43 + e6a5e45 commit ec19608
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion resources/Site.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,21 @@ function buildSite(buildRoot, site, filter) {
!filter ||
(filter.test ? filter.test(file.absPath) : filter === file.absPath))
.map(file => writer(buildRoot, file, site))
);
).then(() => {
// Manually copy sitemap.xml
const sitemapSrc = path.join(site.root, 'spec/sitemap.xml');
const sitemapDest = path.join(buildRoot, 'sitemap.xml');
try {
if (fs.existsSync(sitemapSrc)) {
fs.copyFileSync(sitemapSrc, sitemapDest);
console.log('sitemap.xml copied to build directory');
} else {
console.log('sitemap.xml not found in the source directory');
}
} catch (err) {
console.error('Error copying sitemap:', err);
}
});
}


Expand Down

0 comments on commit ec19608

Please sign in to comment.