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

Support URLs containing slashes #6

Closed
mattwcole opened this issue Jun 25, 2020 · 6 comments · Fixed by #7
Closed

Support URLs containing slashes #6

mattwcole opened this issue Jun 25, 2020 · 6 comments · Fixed by #7

Comments

@mattwcole
Copy link
Contributor

Currently the plugin assumes that all Strapi pages are at the root of the site. URLs like https://my-site.com/articles/my-strapi-article-1 are not supported because the UID field used in the sitemap doesn't allow slashes. Custom entries have the same problem. I had a go at a solution here that adds an area property to the settings for both custom and collection entries. Let me know what you think.

image

@boazpoolman
Copy link
Member

This looks great. I was kind of hoping that this 'prefix' feature would be added to the UID field type directly. Nonetheless this adds a lot of value to the plugin. I'll test it out. Could you create a PR?

@mattwcole
Copy link
Contributor Author

Agreed it would be more useful to allow this in UID field. I've put up a PR, feel free to amend as needed.

@boazpoolman boazpoolman linked a pull request Jun 25, 2020 that will close this issue
@boazpoolman
Copy link
Member

boazpoolman commented Jun 26, 2020

I made a couple of changes, most primarily:

  • The regex for the custom entry slug field allows '/', which makes the area field here redundant.
  • The area field is now an InputUID component (just like slug) to prevent incorrect input.

See #9

@mattwcole
Copy link
Contributor Author

Nice job, thanks for fixing. The only issue I see with making the area field a UID too is if a URL path needs multiple slashes eg https://my-site.com/articles/help/my-strapi-help-article1 (probably more likely for custom entries). Not my use case though, so this fix should unblock us.

@boazpoolman
Copy link
Member

That should not be an issue anymore because I've altered the regex of the UID field to allow slashes.
That said: I want to add a couple more things before making a new release to npm. Next release will likely be somewhere at the start of next week.

@boazpoolman
Copy link
Member

Fixed in v1.1.2 (https://github.com/boazpoolman/strapi-plugin-sitemap/releases/tag/1.1.2)
Thanks for the work :)

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

Successfully merging a pull request may close this issue.

2 participants