Skip to main content
Version: next

generateMetas

The generateMetas helper will generate metadatas for your site.

The main features of this helper are:

  • Merge metadata with parents Metadata (defined in the parent routes / root.tsx)
  • Will allow easier canonical generation
tip

We highly recommend you to use this helper as it will make your life easier when using nested routes. However you can still use the standard Remix Meta method

Usage

  • The first parameter is a Remix V2 Meta Function
  • The second parameter is the canonical path (base url will be automatically injected)
import { MetaFunction } from "@remix-run/node";
import { generateMetas } from "@front-commerce/remix/node";

export const meta: MetaFunction = (args) => {
const metas = generateMetas(() => [{ title: "Welcome home" }], "/");
return metas(args);
};