Open jakub-bujakowski opened 1 year ago
This issue occurs both locally on iOS & also in CI/CD environment (in my case TeamCity). It looks like the plugin always generates the sitemap.xsl file in the root folder and doesn't respect the output path for sitemap.xml.
sitemap.xsl
sitemap.xml
This is my plugin config in gatsby-config file:
gatsby-config
{ resolve: "gatsby-plugin-advanced-sitemap", options: { output: `${process.env.GATSBY_ASSET_PATH}sitemap/sitemap-index.xml`, excludes: [ "/global/*", "/5xx", "/*/404", "/preview", ], additionalSitemaps: [ { name: `blog`, url: `/blog/sitemap.xml`, }, ], }, },
The process.env.GATSBY_ASSET_PATH variable is set to /assets/gtsb/
process.env.GATSBY_ASSET_PATH
/assets/gtsb/
When I build production I get this file structure:
│ sitemap.xsl └───assets │ └───gtsb │ │ sitemap-pages.xml │ │ sitemap.xml
Inside of sitemap.xml the stylesheet href points to sitemap.xsl instead of ../../sitemap.xsl resulting in 404 for sitemap.xsl.
href
../../sitemap.xsl
Is there any way to fix the href link or copy the .xsl file to my output path?
.xsl
output
Result: Only the .xml files get copied to that output, the .xsl file is generated in the root. The .xml file contains
.xml
Expected Result: Both files are copied to output path
+1
Issue Summary
This issue occurs both locally on iOS & also in CI/CD environment (in my case TeamCity). It looks like the plugin always generates the
sitemap.xsl
file in the root folder and doesn't respect the output path forsitemap.xml
.This is my plugin config in
gatsby-config
file:The
process.env.GATSBY_ASSET_PATH
variable is set to/assets/gtsb/
When I build production I get this file structure:
Inside of
sitemap.xml
the stylesheethref
points tositemap.xsl
instead of../../sitemap.xsl
resulting in 404 forsitemap.xsl
.Is there any way to fix the href link or copy the
.xsl
file to myoutput
path?To Reproduce
output
pathResult: Only the
.xml
files get copied to that output, the.xsl
file is generated in the root. The.xml
file containsExpected Result: Both files are copied to
output
pathTechnical details: