istio.io icon indicating copy to clipboard operation
istio.io copied to clipboard

Hide /blog/ from archives using Netlify redirects

Open craigbox opened this issue 1 year ago • 1 comments

One angle we can hit the https://istio.io/v1.15/blog/2022/introducing-ambient-mesh/ problem from is having anything that contains https://istio.io/v.*/blog/ or https://istio.io/v.*/news/ redirect to /latest/.

As these sections are append-only, there's no value in having old versions of them visible.

https://docs.netlify.com/edge-functions/api/ should make this possible.

craigbox avatar Apr 29 '24 07:04 craigbox

I discussed this with Sam (one of our docs interns) today, about how we should be able to implement and test this.

Broadly: we hope that if you create the edge function in the source, and then submit a PR, it should work in the deployment preview.

You should also be able to test these using netlify dev, run from the public/ directory of a Hugo build.

In the first instance, try sending anything that (a) includes /v.*/ (b) doesn't include /docs/, to /latest/.

We will then need to test if this breaks anything major.

craigbox avatar Mar 24 '25 23:03 craigbox