retype icon indicating copy to clipboard operation
retype copied to clipboard

Remove trailing slash from page URLs

Open xyeLz opened this issue 3 years ago • 7 comments

It is my understanding that for SEO, pages should not have trailing slashes. Would it be possible to remove trailing slashes on URLs where applicable?

xyeLz avatar Aug 17 '22 20:08 xyeLz

Please add the following to your projects retype.yml file:

generator:
  trailingSlash: false

Hope this helps.

geoffreymcgill avatar Aug 17 '22 20:08 geoffreymcgill

Thanks! Will the page load without the slash and then redirect to the page with the slash?

xyeLz avatar Aug 17 '22 20:08 xyeLz

This seems to cause weird formatting issues with my site. I suspected a possible caching issue but even when accessing the site directly using the latest build https://d073989f.retypetest.pages.dev it still seems to cause the issue. For example, the logo in the top left appears initially but then disappears. Occasionally/randomly, my site loses all CSS formatting and just becomes a basic HTML page.

xyeLz avatar Aug 17 '22 20:08 xyeLz

I was able to reproduce with your live site. There is something strange happening with how the paths to the static resources are being emitted. I'll need to run some tests and see if I can reproduce locally.

geoffreymcgill avatar Aug 17 '22 21:08 geoffreymcgill

Sorry, but I've lost track of where your public repo for this content is located. Can you share a link to the repo again?

geoffreymcgill avatar Aug 17 '22 21:08 geoffreymcgill

Yes, there appears to be an issue with how the paths are being resolved for the static resources when trailingSlash: false is set in the project retype.yml file.

For now, please remove trailingSlash: false or set to true.

# generator:
#   trailingSlash: false

We are investigating.

geoffreymcgill avatar Aug 17 '22 21:08 geoffreymcgill

Sorry, but I've lost track of where your public repo for this content is located. Can you share a link to the repo again?

Sure! It’s https://github.com/alukosdev/retypetest

xyeLz avatar Aug 17 '22 22:08 xyeLz