Skip to content

Conversation

@mrpollo
Copy link
Contributor

@mrpollo mrpollo commented Oct 8, 2025

Enable clean urls for vitepress builds

cc @hamishwillee please verify this is actually building the files as we need them, suposedly creating directories with index files so the urls are clean

@hamishwillee
Copy link
Contributor

@mrpollo There is no way to test this locally because the live server always supports either clean or non-clean URLs. I did make the modification and test that. I also built the library locally and compared the output with cleanUrls: true - the content of the files is different, but all generated files have the same .html extension.

Upshot, I suspect that with the suggested change this might work, but it is hard to tell. We'll probably have to deploy and test.

@mrpollo mrpollo force-pushed the mrpollo/docs_clean_urls branch from 2c8e2f4 to 81fd938 Compare October 9, 2025 16:21
@mrpollo mrpollo force-pushed the mrpollo/docs_clean_urls branch from 81fd938 to 3ee2d49 Compare October 9, 2025 16:22
@mrpollo mrpollo marked this pull request as ready for review October 9, 2025 20:32
@dakejahl dakejahl merged commit aa06686 into main Oct 14, 2025
5 checks passed
@dakejahl dakejahl deleted the mrpollo/docs_clean_urls branch October 14, 2025 04:52
@hamishwillee
Copy link
Contributor

@mrpollo @dakejahl Just some follow on testing

What this change does is (I think) force Vitepress to open clean URLs by default and redirect to clean URLs by default. So if you open a sitebar you always get a clean URL, and if you enter https://docs.px4.io/main/en/flying/plan_safety_points.html it will redirect to https://docs.px4.io/main/en/flying/plan_safety_points

I tested this and it works. The other builds do not use clean URLs so if you open a sidebar they will still have .html extension. I don't think it matters - all the URLs work if you navigate to the site so no links are broken.

Thanks!

@mrpollo
Copy link
Contributor Author

mrpollo commented Oct 15, 2025

@hamishwillee i realized the behavior on older releases was going to be different, but it also looks like its not a big deal. However I do have better visibility into 404's in the server logs now that we moved away from github pages, i will keep an eye for issues.

@hamishwillee
Copy link
Contributor

Great. I have made v1.16 match. I don't think this will be any kind of problem

mrpollo added a commit that referenced this pull request Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants