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>
21 lines
616 B
JavaScript
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);
|
|
}
|
|
})();
|