11.stylix/doc/redirects.js
Flameopathic 1a471ee95e
neovim: combine Neovim, Neovide, NixVim, nvf, and Vim (#1377)
Closes: https://github.com/nix-community/stylix/issues/1189
Link: https://github.com/nix-community/stylix/pull/1377

Reviewed-by: Adam M. Szalkowski <a.szalkowski@datahow.ch>
Tested-by: Adam M. Szalkowski <a.szalkowski@datahow.ch>
Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk>
Tested-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
2025-06-12 17:28:51 +02:00

21 lines
616 B
JavaScript

(function () {
// A table of paths to redirect from, mapped to the new location.
// NOTE: This script doesn't run on 404.html, so the old page must still exist.
const redirects = {
"/configuration.html#standalone-nixvim":
"./options/modules/neovim.html#standalone-mode",
};
const fullPath = window.location.pathname + window.location.hash;
// Remove baseHref
const path =
fullPath.indexOf("/stylix/") == 0 ? fullPath.substring(7) : fullPath;
const target = redirects[path];
if (target) {
console.log("Redirecting to " + target);
window.location.replace(target);
}
})();