JuliaPlots / PlotDocs.jl

Documentation for Plots.jl
http://docs.juliaplots.org/stable
MIT License
94 stars 96 forks source link

Maybe fix redirects in netlify #337

Closed fonsp closed 1 year ago

fonsp commented 1 year ago

I'm not good with grep and sed so I hope I did this correctly

This PR uses the * and :splat features to redirect all subpaths, not just the path itself:

https://docs.netlify.com/routing/redirects/redirect-options/#splats

netlify[bot] commented 1 year ago

Deploy Preview for juliaplots ready!

Name Link
Latest commit
Latest deploy log https://app.netlify.com/sites/juliaplots/deploys/63ca8dfd1303d122ad23158a
Deploy Preview https://deploy-preview-337--juliaplots.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

fonsp commented 1 year ago

Seems to work now!

Only thing left is: redirect /v1.38 to /v1.38/, /latest to /latest/, etc. (Because the version selector in the bottom right send you to /v1.38 instead of /v1.38/.)

Right now we have

[[redirects]]
  from = "/v1.30/*"
  to = "/v1.30.2/:splat"
  status = 200
  force = true

you could add a second rule:

[[redirects]]
  from = "/v1.30/*"
  to = "/v1.30.2/:splat"
  status = 200
  force = true
[[redirects]]
  from = "/v1.30"
  to = "/v1.30/"
BeastyBlacksmith commented 1 year ago

Thanks! Do you happen to know what counts for the Bandwith limit? Is that the traffic of the viewers?

BeastyBlacksmith commented 1 year ago

you could add a second rule:

Thats not working.

https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash

fonsp commented 1 year ago

Ah sorry, missed that part. Did you enable the "Pretty URLs" feature already?

fonsp commented 1 year ago

Bandwidth limit is about outbound data transfer to site visitors. If bandwidth ever becomes an issue, you could apply for https://www.netlify.com/legal/open-source-policy/ (worked for Pluto).

BeastyBlacksmith commented 1 year ago

Ah sorry, missed that part. Did you enable the "Pretty URLs" feature already?

Yes

BeastyBlacksmith commented 1 year ago

I'll merge this as is and hope for https://github.com/JuliaDocs/Documenter.jl/pull/2023 to get merged