Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference to style.xsl file doesn't work when using a subdirectory #21

Closed
hbanham opened this issue Mar 21, 2023 · 1 comment
Closed

Comments

@hbanham
Copy link

hbanham commented Mar 21, 2023

Describe the bug

For websites that are hosted in a subdirectory, for example https://example.com/subdirectory/{files}
I configure Nuxt's baseURL and Nitro's publicDir to output the site files in the subdirectory required.

The sitemap.xml references the style.xsl file using an absolute path:
image

This means that when we have a project that has a subdirectory structure, it cannot find the file because it is looking for
https://example.com/__sitemap__/style.xsl
instead of
https://example.com/subdirectory/__sitemap__/style.xsl

image

Maybe the href could be a relative path or perhaps use app.baseURL?

In the reproduction:

  1. npm run dev (and go to /subdirectory/sitemap.xml)

or

  1. npm run generate
  2. npm run serve (and go to /subdirectory/sitemap.xml)

Thank you!

Reproduction

https://stackblitz.com/edit/nuxt-starter-wuerx5

System / Nuxt Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz    
    Memory: 2.01 GB / 15.85 GB
  Binaries:
    Node: 18.12.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD  
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 110.0.5481.177
    Edge: Spartan (44.19041.1266.0), Chromium (110.0.1587.57)
    Internet Explorer: 11.0.19041.1566
@hbanham hbanham changed the title Reference to sitemap style.xsl file doesn't work when using a subdirectory Reference to style.xsl file doesn't work when using a subdirectory Mar 21, 2023
@harlan-zw
Copy link
Collaborator

Thank you @hbanham

The testing infrastructure I have doesn't have the baseURL support currently so I apologise for the regressions.

This should be fixed in 2.2.0 though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants