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

Creation of sitemap.xml files in sub directory #306

Open
rberneder opened this issue Apr 4, 2023 · 4 comments
Open

Creation of sitemap.xml files in sub directory #306

rberneder opened this issue Apr 4, 2023 · 4 comments
Labels

Comments

@rberneder
Copy link

There is the possibility to set the target directory where the files shall be dumped to. However the links between the generated section-xml-files don't respect that and try link the files from the web root.

Similar to the file prefix a sub-directory config would be great so the created links between each sitemap-file add this sub-directory in each path.

@norkunas
Copy link
Contributor

norkunas commented Apr 4, 2023

I think if you are dumping to the sub-dir then you should configure routing prefix to be same in config/routes/presta_sitemap.yaml or where you import the routes

@rberneder
Copy link
Author

If I understand correctly, you are proposing to expose the routes to the sitemap generation controller (which generates the sitemap on the fly). Due to the large amount of pages I prefer generating the sitemap.xml files regularly with a cron job:

bin/console presta:sitemaps:dump /var/www/public/sitemap/site-1 --base-url="https://www.site-1.com"

I think all it needs is to have an additional "relative-path-to-sitemap" parameter that is added to all sitemap-section-links.

@yann-eugone
Copy link
Member

From an historical point of view, this bundle was created to serve sitemap on the fly
But indeed, we moved to the dump command, because it was too much for an HTTP endpoint
This is why there is some code aimed to be working on the HTTP side that still works on dump command
So yes, I believe you could put some path in sitemap_file_prefix (ie site-1/sitemap) and it might work

But I think we better rethink this whole thing by making an inventory of all use cases we want to cover, and find a way to rewrite these code parts with new config structure

@BriceFab
Copy link

I've the same issue.

It's related with #138

If you set --base-url, it will work. But it's not consistent

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

No branches or pull requests

4 participants