Skip to content

Commit

Permalink
fix more broken URLs (#1486)
Browse files Browse the repository at this point in the history
Tested with netlify-cli!

Note that this changes semantics, and now redirects `unstable` to the
latest Nix version rather than to the most recent build from `master`.
This is to avoid
- either more downstream errors with "pretty URLs", which are not
supported by Hydra
- or expensively re-building the manual on nix.dev regularly just to
work around Hydra's limitations

This is probably what we want.
I assume that most people will use the latest Nix release rather than
`master`.
For those who live on `master` there's still
https://nix.dev/manual/nix/development, and presumably being power users
they will hopefully know that.

Closes:
- NixOS/nix.dev#1005
- NixOS/nix.dev#1006
- #1483
- NixOS/nix.dev#996
- https://discourse.nixos.org/t/avoid-string-interpolation-nix/30772/9

Thanks everyone for participating in this involuntary scream test,
continuing our year-long tradition of compaint-based, anger-driven
development. ;)
  • Loading branch information
fricklerhandwerk committed Jun 29, 2024
1 parent 52aa813 commit 4f8589c
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions public/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -197,27 +197,45 @@
force = true

[[redirects]]
# these rather old links are still used in the Nixpkgs manual
from = "/nix/manual/*"
from = "/manual/nix/stable/*"
to = "https://nix.dev/manual/nix/stable/:splat"
status = 302
force = true

[[redirects]]
from = "/manual/nix/*"
from = "/manual/nix/unstable/*"
to = "https://nix.dev/manual/nix/latest/:splat"
status = 302
force = true

[[redirects]]
from = "/manual/nix/stable/*"
to = "https://nix.dev/manual/nix/latest/:splat"
# catch links to the top-level
from = "/manual/nix"
# this must not have a trailing slash!
# otherwise, CSS won't be loaded
to = "https://nix.dev/manual/nix"
status = 302
force = true

[[redirects]]
from = "/manual/nix/unstable/*"
to = "https://nix.dev/manual/nix/development/:splat"
from = "/manual/nix/*"
to = "https://nix.dev/manual/nix/:splat"
status = 302
force = true

# these rather old links are still used in the Nixpkgs manual
[[redirects]]
# catch links to the top-level
from = "/nix/manual"
# this must not have a trailing slash!
# otherwise, CSS won't be loaded
to = "https://nix.dev/manual/nix"
status = 302
force = true

[[redirects]]
from = "/nix/manual/*"
to = "https://nix.dev/manual/nix/:splat"
status = 302
force = true

Expand Down

0 comments on commit 4f8589c

Please sign in to comment.