vike
vike copied to clipboard
Setting `+redirects` improve alias support
Description
Maybe as a new setting +alias? Or maybe +redirects.alias? To save client-side KBs it would be nice to not send the whole redirects setting to the client-side.
See also:
- https://vike.dev/redirects#alias
- https://github.com/vikejs/vike/issues/2375
It would be really nice to have those new settings:
- +alias for client-side redirection
- +appName as a complement to the title to combine themes in the tabs, among other things
I'm waiting for the new release!
In the meantime, I've implemented the following:
// +onBeforeRender.ts
import { render } from "vike/abort";
import type { OnBeforeRenderAsync } from "vike/types";
export const onBeforeRender: OnBeforeRenderAsync = async (pageContext) => {
console.log(pageContext.urlPathname);
if (pageContext.urlPathname === "/terms-and-conditions-of-sale") {
throw render("/terms-of-service");
}
if (pageContext.urlPathname === "/terms-and-conditions-of-use") {
throw render("/terms-of-service");
}
};
to combine themes in the tabs, among other things
Can you elaborate at https://github.com/vikejs/vike/issues/2151?
to combine themes in the tabs, among other things
Can you elaborate at https://github.com/vikejs/vike/issues/2151?
I'm in ಠᴥಠ